diff --git a/admin/03a29dbd19f5985ace58f50caf78c6e5d2fe78cbe1e4922a8b949bbe804f53cb.go b/admin/03a29dbd19f5985ace58f50caf78c6e5d2fe78cbe1e4922a8b949bbe804f53cb.go new file mode 100644 index 00000000000..cf3d00ddc64 --- /dev/null +++ b/admin/03a29dbd19f5985ace58f50caf78c6e5d2fe78cbe1e4922a8b949bbe804f53cb.go @@ -0,0 +1,173 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters get previousVersions from admin +type ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + m := &ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions/{resourcePolicyDefinitionVersion%2Dversion}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder instantiates a new ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property previousVersions for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get previousVersions from admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// Patch update the navigation property previousVersions in admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// ToDeleteRequestInformation delete navigation property previousVersions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get previousVersions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property previousVersions in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + return NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/1857ac28db1d07f572881ae94f46e7de830455a5908a7475c7a40d4378b6af7f.go b/admin/1857ac28db1d07f572881ae94f46e7de830455a5908a7475c7a40d4378b6af7f.go new file mode 100644 index 00000000000..ce6ca4c6771 --- /dev/null +++ b/admin/1857ac28db1d07f572881ae94f46e7de830455a5908a7475c7a40d4378b6af7f.go @@ -0,0 +1,173 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters get previousVersions from admin +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions/{resourcePolicyDefinitionVersion%2Dversion}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property previousVersions for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get previousVersions from admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// Patch update the navigation property previousVersions in admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// ToDeleteRequestInformation delete navigation property previousVersions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get previousVersions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property previousVersions in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/2878720210c653a94fc34c1ad28c9eac27ba96842d84ab808f478a5971d6b2ee.go b/admin/2878720210c653a94fc34c1ad28c9eac27ba96842d84ab808f478a5971d6b2ee.go new file mode 100644 index 00000000000..410dd26d02f --- /dev/null +++ b/admin/2878720210c653a94fc34c1ad28c9eac27ba96842d84ab808f478a5971d6b2ee.go @@ -0,0 +1,191 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder provides operations to manage the definitions property of the microsoft.graph.resourcePolicyDeletableRoot entity. +type ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters get definitions from admin +type ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// Assignments provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Assignments() *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property definitions for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get definitions from admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// Patch update the navigation property definitions in admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// PreviousVersions provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) PreviousVersions() *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Restore provides operations to call the restore method. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Restore() *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToDeleteRequestInformation delete navigation property definitions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get definitions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property definitions in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/341f7995efad29973fb2e8e112566c14a63c5c3a4127addbce7f235ff899e781.go b/admin/341f7995efad29973fb2e8e112566c14a63c5c3a4127addbce7f235ff899e781.go new file mode 100644 index 00000000000..880a08e3d61 --- /dev/null +++ b/admin/341f7995efad29973fb2e8e112566c14a63c5c3a4127addbce7f235ff899e781.go @@ -0,0 +1,173 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters get previousVersions from admin +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions/{resourcePolicyDefinitionVersion%2Dversion}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property previousVersions for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get previousVersions from admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// Patch update the navigation property previousVersions in admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// ToDeleteRequestInformation delete navigation property previousVersions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get previousVersions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property previousVersions in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/39d74d0f9f520190e3b72fd9c656461c29c0a110fc66bce1de0b19cce4abb17b.go b/admin/39d74d0f9f520190e3b72fd9c656461c29c0a110fc66bce1de0b19cce4abb17b.go new file mode 100644 index 00000000000..f01677135fc --- /dev/null +++ b/admin/39d74d0f9f520190e3b72fd9c656461c29c0a110fc66bce1de0b19cce4abb17b.go @@ -0,0 +1,91 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters +} + +// NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/assignments/{resourcePolicyAssignment%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/ac54645e6c2e78b9be3c30b0aed1b5bc4ec4d97b296ad7dc672e1d863caf3fa0.go b/admin/ac54645e6c2e78b9be3c30b0aed1b5bc4ec4d97b296ad7dc672e1d863caf3fa0.go new file mode 100644 index 00000000000..89293f153b4 --- /dev/null +++ b/admin/ac54645e6c2e78b9be3c30b0aed1b5bc4ec4d97b296ad7dc672e1d863caf3fa0.go @@ -0,0 +1,179 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDeletableRoot entity. +type ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + m := &ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/assignments/{resourcePolicyAssignment%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder instantiates a new ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property assignments for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// Patch update the navigation property assignments in admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// Restore provides operations to call the restore method. +// returns a *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Restore() *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToDeleteRequestInformation delete navigation property assignments for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property assignments in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/admin_request_builder.go b/admin/admin_request_builder.go index 635289dbda0..c51148de42b 100644 --- a/admin/admin_request_builder.go +++ b/admin/admin_request_builder.go @@ -164,6 +164,12 @@ func (m *AdminRequestBuilder) ReportSettings() *ReportSettingsRequestBuilder { return NewReportSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// ResourcePolicy provides operations to manage the resourcePolicy property of the microsoft.graph.admin entity. +// returns a *ResourcePolicyRequestBuilder when successful +func (m *AdminRequestBuilder) ResourcePolicy() *ResourcePolicyRequestBuilder { + return NewResourcePolicyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ServiceAnnouncement provides operations to manage the serviceAnnouncement property of the microsoft.graph.admin entity. // returns a *ServiceAnnouncementRequestBuilder when successful func (m *AdminRequestBuilder) ServiceAnnouncement() *ServiceAnnouncementRequestBuilder { diff --git a/admin/ae51b932669e9a6675943da1630659abf5f130ef218b168bcf5f1ae347474375.go b/admin/ae51b932669e9a6675943da1630659abf5f130ef218b168bcf5f1ae347474375.go new file mode 100644 index 00000000000..68cd28b8244 --- /dev/null +++ b/admin/ae51b932669e9a6675943da1630659abf5f130ef218b168bcf5f1ae347474375.go @@ -0,0 +1,91 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + m := &ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/assignments/{resourcePolicyAssignment%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder instantiates a new ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + return NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/configuration_management_configuration_monitors_configuration_monitor_item_request_builder.go b/admin/configuration_management_configuration_monitors_configuration_monitor_item_request_builder.go index 1cb0b728688..a18173caeff 100644 --- a/admin/configuration_management_configuration_monitors_configuration_monitor_item_request_builder.go +++ b/admin/configuration_management_configuration_monitors_configuration_monitor_item_request_builder.go @@ -114,7 +114,7 @@ func (m *ConfigurationManagementConfigurationMonitorsConfigurationMonitorItemReq return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConfigurationMonitorable), nil } -// Patch update the properties of a configurationMonitor object, including the monitor name, description, and baseline. You must provide the full monitor body when you call this API. +// Patch update the properties of a configurationMonitor, including its name, description, baseline, mode, status, or referenced version of the same template. When updating an inline baseline, provide the full monitor body as described in the request body section. // returns a ConfigurationMonitorable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -165,7 +165,7 @@ func (m *ConfigurationManagementConfigurationMonitorsConfigurationMonitorItemReq return requestInfo, nil } -// ToPatchRequestInformation update the properties of a configurationMonitor object, including the monitor name, description, and baseline. You must provide the full monitor body when you call this API. +// ToPatchRequestInformation update the properties of a configurationMonitor, including its name, description, baseline, mode, status, or referenced version of the same template. When updating an inline baseline, provide the full monitor body as described in the request body section. // returns a *RequestInformation when successful func (m *ConfigurationManagementConfigurationMonitorsConfigurationMonitorItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConfigurationMonitorable, requestConfiguration *ConfigurationManagementConfigurationMonitorsConfigurationMonitorItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/admin/configuration_management_configuration_monitors_item_baseline_request_builder.go b/admin/configuration_management_configuration_monitors_item_baseline_request_builder.go index e2fd328f774..8daace95ae6 100644 --- a/admin/configuration_management_configuration_monitors_item_baseline_request_builder.go +++ b/admin/configuration_management_configuration_monitors_item_baseline_request_builder.go @@ -15,7 +15,7 @@ type ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilder stru i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilderGetQueryParameters read the properties and relationships of a configurationBaseline object that is attached to a specific monitor. +// ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilderGetQueryParameters get the configurationBaseline attached to a monitor or a configurationTemplateVersion. type ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilder(r return NewConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilderInternal(urlParams, requestAdapter) } -// Get read the properties and relationships of a configurationBaseline object that is attached to a specific monitor. +// Get get the configurationBaseline attached to a monitor or a configurationTemplateVersion. // returns a ConfigurationBaselineable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -72,7 +72,7 @@ func (m *ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilder) return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConfigurationBaselineable), nil } -// ToGetRequestInformation read the properties and relationships of a configurationBaseline object that is attached to a specific monitor. +// ToGetRequestInformation get the configurationBaseline attached to a monitor or a configurationTemplateVersion. // returns a *RequestInformation when successful func (m *ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ConfigurationManagementConfigurationMonitorsItemBaselineRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/admin/configuration_management_configuration_monitors_request_builder.go b/admin/configuration_management_configuration_monitors_request_builder.go index faaf263c9d8..fb84cb0e7f2 100644 --- a/admin/configuration_management_configuration_monitors_request_builder.go +++ b/admin/configuration_management_configuration_monitors_request_builder.go @@ -111,7 +111,7 @@ func (m *ConfigurationManagementConfigurationMonitorsRequestBuilder) Get(ctx con return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConfigurationMonitorCollectionResponseable), nil } -// Post create a new configurationMonitor object that runs periodically in the background at a scheduled frequency. +// Post create a new configurationMonitor object that runs periodically in the background at a scheduled frequency to detect configuration drift in monitorOnly mode, or applies a desired-state baseline once in applyOnce mode. // returns a ConfigurationMonitorable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -150,7 +150,7 @@ func (m *ConfigurationManagementConfigurationMonitorsRequestBuilder) ToGetReques return requestInfo, nil } -// ToPostRequestInformation create a new configurationMonitor object that runs periodically in the background at a scheduled frequency. +// ToPostRequestInformation create a new configurationMonitor object that runs periodically in the background at a scheduled frequency to detect configuration drift in monitorOnly mode, or applies a desired-state baseline once in applyOnce mode. // returns a *RequestInformation when successful func (m *ConfigurationManagementConfigurationMonitorsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConfigurationMonitorable, requestConfiguration *ConfigurationManagementConfigurationMonitorsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/admin/d99e8b2ec8e065dcd7d24da162a5df9b32000e6c461718a6d82db8d175293746.go b/admin/d99e8b2ec8e065dcd7d24da162a5df9b32000e6c461718a6d82db8d175293746.go new file mode 100644 index 00000000000..bc2487ee86d --- /dev/null +++ b/admin/d99e8b2ec8e065dcd7d24da162a5df9b32000e6c461718a6d82db8d175293746.go @@ -0,0 +1,91 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/assignments/{resourcePolicyAssignment%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_assignments_count_request_builder.go b/admin/resource_policy_assignments_count_request_builder.go new file mode 100644 index 00000000000..292a1799c7b --- /dev/null +++ b/admin/resource_policy_assignments_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyAssignmentsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyAssignmentsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyAssignmentsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyAssignmentsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyAssignmentsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyAssignmentsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyAssignmentsCountRequestBuilderInternal instantiates a new ResourcePolicyAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsCountRequestBuilder { + m := &ResourcePolicyAssignmentsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/assignments/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyAssignmentsCountRequestBuilder instantiates a new ResourcePolicyAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyAssignmentsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyAssignmentsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyAssignmentsCountRequestBuilder { + return NewResourcePolicyAssignmentsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_assignments_item_restore_request_builder.go b/admin/resource_policy_assignments_item_restore_request_builder.go new file mode 100644 index 00000000000..c8a28b01b65 --- /dev/null +++ b/admin/resource_policy_assignments_item_restore_request_builder.go @@ -0,0 +1,78 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyAssignmentsItemRestoreRequestBuilder provides operations to call the restore method. +type ResourcePolicyAssignmentsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyAssignmentsItemRestoreRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsItemRestoreRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyAssignmentsItemRestoreRequestBuilderInternal instantiates a new ResourcePolicyAssignmentsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsItemRestoreRequestBuilder { + m := &ResourcePolicyAssignmentsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/assignments/{resourcePolicyAssignment%2DuniqueName}/restore", pathParameters), + } + return m +} + +// NewResourcePolicyAssignmentsItemRestoreRequestBuilder instantiates a new ResourcePolicyAssignmentsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsItemRestoreRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyAssignmentsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action restore +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsItemRestoreRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToPostRequestInformation invoke action restore +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsItemRestoreRequestBuilderPostRequestConfiguration) (*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") + 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. +// returns a *ResourcePolicyAssignmentsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyAssignmentsItemRestoreRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyAssignmentsItemRestoreRequestBuilder { + return NewResourcePolicyAssignmentsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_assignments_request_builder.go b/admin/resource_policy_assignments_request_builder.go new file mode 100644 index 00000000000..3108c2b591d --- /dev/null +++ b/admin/resource_policy_assignments_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyAssignmentsRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyAssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyAssignmentsRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyAssignmentsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyAssignmentsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyAssignmentsRequestBuilderGetQueryParameters +} + +// ResourcePolicyAssignmentsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyAssignmentUniqueName provides operations to manage the assignments property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyAssignmentsRequestBuilder) ByResourcePolicyAssignmentUniqueName(resourcePolicyAssignmentUniqueName string) *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyAssignmentUniqueName != "" { + urlTplParams["resourcePolicyAssignment%2DuniqueName"] = resourcePolicyAssignmentUniqueName + } + return NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyAssignmentsRequestBuilderInternal instantiates a new ResourcePolicyAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsRequestBuilder { + m := &ResourcePolicyAssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/assignments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyAssignmentsRequestBuilder instantiates a new ResourcePolicyAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyAssignmentsRequestBuilder) Count() *ResourcePolicyAssignmentsCountRequestBuilder { + return NewResourcePolicyAssignmentsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable), nil +} + +// Post create new navigation property to assignments for admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyAssignmentsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to assignments for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyAssignmentsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyAssignmentsRequestBuilder when successful +func (m *ResourcePolicyAssignmentsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyAssignmentsRequestBuilder { + return NewResourcePolicyAssignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_assignments_resource_policy_assignment_unique_name_item_request_builder.go b/admin/resource_policy_assignments_resource_policy_assignment_unique_name_item_request_builder.go new file mode 100644 index 00000000000..5b0d677b261 --- /dev/null +++ b/admin/resource_policy_assignments_resource_policy_assignment_unique_name_item_request_builder.go @@ -0,0 +1,179 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + m := &ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/assignments/{resourcePolicyAssignment%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder instantiates a new ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property assignments for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// Patch update the navigation property assignments in admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// Restore provides operations to call the restore method. +// returns a *ResourcePolicyAssignmentsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) Restore() *ResourcePolicyAssignmentsItemRestoreRequestBuilder { + return NewResourcePolicyAssignmentsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToDeleteRequestInformation delete navigation property assignments for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property assignments in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + return NewResourcePolicyAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_count_request_builder.go b/admin/resource_policy_built_in_definitions_count_request_builder.go new file mode 100644 index 00000000000..fd7295fcccb --- /dev/null +++ b/admin/resource_policy_built_in_definitions_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyBuiltInDefinitionsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyBuiltInDefinitionsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyBuiltInDefinitionsCountRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsCountRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsCountRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsCountRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsCountRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsCountRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsCountRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_item_assignments_count_request_builder.go b/admin/resource_policy_built_in_definitions_item_assignments_count_request_builder.go new file mode 100644 index 00000000000..fc362d4ce3f --- /dev/null +++ b/admin/resource_policy_built_in_definitions_item_assignments_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/assignments/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_item_assignments_request_builder.go b/admin/resource_policy_built_in_definitions_item_assignments_request_builder.go new file mode 100644 index 00000000000..76ea6986883 --- /dev/null +++ b/admin/resource_policy_built_in_definitions_item_assignments_request_builder.go @@ -0,0 +1,122 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetQueryParameters +} + +// ByResourcePolicyAssignmentUniqueName provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder) ByResourcePolicyAssignmentUniqueName(resourcePolicyAssignmentUniqueName string) *ResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyAssignmentUniqueName != "" { + urlTplParams["resourcePolicyAssignment%2DuniqueName"] = resourcePolicyAssignmentUniqueName + } + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/assignments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder) Count() *ResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_item_previous_versions_count_request_builder.go b/admin/resource_policy_built_in_definitions_item_previous_versions_count_request_builder.go new file mode 100644 index 00000000000..5da87c380af --- /dev/null +++ b/admin/resource_policy_built_in_definitions_item_previous_versions_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_item_previous_versions_request_builder.go b/admin/resource_policy_built_in_definitions_item_previous_versions_request_builder.go new file mode 100644 index 00000000000..97580381f9f --- /dev/null +++ b/admin/resource_policy_built_in_definitions_item_previous_versions_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters get previousVersions from admin +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters +} + +// ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyDefinitionVersionVersion provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) ByResourcePolicyDefinitionVersionVersion(resourcePolicyDefinitionVersionVersion string) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyDefinitionVersionVersion != "" { + urlTplParams["resourcePolicyDefinitionVersion%2Dversion"] = resourcePolicyDefinitionVersionVersion + } + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) Count() *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get previousVersions from admin +// returns a ResourcePolicyDefinitionVersionCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionCollectionResponseable), nil +} + +// Post create new navigation property to previousVersions for admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// ToGetRequestInformation get previousVersions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to previousVersions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_item_restore_request_builder.go b/admin/resource_policy_built_in_definitions_item_restore_request_builder.go new file mode 100644 index 00000000000..d98a45423d1 --- /dev/null +++ b/admin/resource_policy_built_in_definitions_item_restore_request_builder.go @@ -0,0 +1,78 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder provides operations to call the restore method. +type ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}/restore", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action restore +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// ToPostRequestInformation invoke action restore +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderPostRequestConfiguration) (*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") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_request_builder.go b/admin/resource_policy_built_in_definitions_request_builder.go new file mode 100644 index 00000000000..083c68e2c60 --- /dev/null +++ b/admin/resource_policy_built_in_definitions_request_builder.go @@ -0,0 +1,122 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsRequestBuilder provides operations to manage the builtInDefinitions property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyBuiltInDefinitionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsRequestBuilderGetQueryParameters get builtInDefinitions from admin +type ResourcePolicyBuiltInDefinitionsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyBuiltInDefinitionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsRequestBuilderGetQueryParameters +} + +// ByResourcePolicyDefinitionUniqueName provides operations to manage the builtInDefinitions property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsRequestBuilder) ByResourcePolicyDefinitionUniqueName(resourcePolicyDefinitionUniqueName string) *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyDefinitionUniqueName != "" { + urlTplParams["resourcePolicyDefinition%2DuniqueName"] = resourcePolicyDefinitionUniqueName + } + return NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyBuiltInDefinitionsRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyBuiltInDefinitionsCountRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsRequestBuilder) Count() *ResourcePolicyBuiltInDefinitionsCountRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get builtInDefinitions from admin +// returns a ResourcePolicyDefinitionCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionCollectionResponseable), nil +} + +// ToGetRequestInformation get builtInDefinitions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_built_in_definitions_resource_policy_definition_unique_name_item_request_builder.go b/admin/resource_policy_built_in_definitions_resource_policy_definition_unique_name_item_request_builder.go new file mode 100644 index 00000000000..dbc0c88049b --- /dev/null +++ b/admin/resource_policy_built_in_definitions_resource_policy_definition_unique_name_item_request_builder.go @@ -0,0 +1,109 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder provides operations to manage the builtInDefinitions property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters get builtInDefinitions from admin +type ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters +} + +// Assignments provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Assignments() *ResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + m := &ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/builtInDefinitions/{resourcePolicyDefinition%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder instantiates a new ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get builtInDefinitions from admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// PreviousVersions provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) PreviousVersions() *ResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemPreviousVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Restore provides operations to call the restore method. +// returns a *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Restore() *ResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToGetRequestInformation get builtInDefinitions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_get_response.go b/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_get_response.go new file mode 100644 index 00000000000..d2822fc314e --- /dev/null +++ b/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_get_response.go @@ -0,0 +1,126 @@ +// 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 ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse instantiates a new ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse and sets the default values. +func NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse() *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse { + m := &ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a *string when successful +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) GetValue() *string { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetValue sets the value property value. The value property +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse) SetValue(value *string) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetValue() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetValue(value *string) +} diff --git a/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_request_builder.go b/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_request_builder.go new file mode 100644 index 00000000000..daa59fe58e8 --- /dev/null +++ b/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_request_builder.go @@ -0,0 +1,102 @@ +// 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" +) + +// ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder provides operations to call the getFederatedIdentityCredentialSubject method. +type ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderInternal instantiates a new ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder and sets the default values. +func NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, appId *string) *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder { + m := &ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/configuration/getFederatedIdentityCredentialSubject(appId='{appId}')", pathParameters), + } + if appId != nil { + m.BaseRequestBuilder.PathParameters["appId"] = *appId + } + return m +} + +// NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder instantiates a new ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder and sets the default values. +func NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderInternal(urlParams, requestAdapter, nil) +} + +// Get invoke function getFederatedIdentityCredentialSubject +// Deprecated: This method is obsolete. Use GetAsGetFederatedIdentityCredentialSubjectWithAppIdGetResponse instead. +// returns a ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderGetRequestConfiguration) (ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseable), nil +} + +// GetAsGetFederatedIdentityCredentialSubjectWithAppIdGetResponse invoke function getFederatedIdentityCredentialSubject +// returns a ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder) GetAsGetFederatedIdentityCredentialSubjectWithAppIdGetResponse(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderGetRequestConfiguration) (ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable), nil +} + +// ToGetRequestInformation invoke function getFederatedIdentityCredentialSubject +// returns a *RequestInformation when successful +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder when successful +func (m *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder { + return NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_response.go b/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_response.go new file mode 100644 index 00000000000..bc4b9a6b75a --- /dev/null +++ b/admin/resource_policy_configuration_get_federated_identity_credential_subject_with_app_id_response.go @@ -0,0 +1,33 @@ +// 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 ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable instead. +type ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse struct { + ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse +} + +// NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse instantiates a new ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse and sets the default values. +func NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse() *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse { + m := &ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse{ + ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse: *NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponse(), + } + return m +} + +// CreateResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponse(), nil +} + +// Deprecated: This class is obsolete. Use ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable instead. +type ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdGetResponseable +} diff --git a/admin/resource_policy_configuration_request_builder.go b/admin/resource_policy_configuration_request_builder.go new file mode 100644 index 00000000000..9865f7324e3 --- /dev/null +++ b/admin/resource_policy_configuration_request_builder.go @@ -0,0 +1,179 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyConfigurationRequestBuilder provides operations to manage the configuration property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyConfigurationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyConfigurationRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyConfigurationRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyConfigurationRequestBuilderGetQueryParameters get configuration from admin +type ResourcePolicyConfigurationRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyConfigurationRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyConfigurationRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyConfigurationRequestBuilderGetQueryParameters +} + +// ResourcePolicyConfigurationRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyConfigurationRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyConfigurationRequestBuilderInternal instantiates a new ResourcePolicyConfigurationRequestBuilder and sets the default values. +func NewResourcePolicyConfigurationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyConfigurationRequestBuilder { + m := &ResourcePolicyConfigurationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/configuration{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyConfigurationRequestBuilder instantiates a new ResourcePolicyConfigurationRequestBuilder and sets the default values. +func NewResourcePolicyConfigurationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyConfigurationRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyConfigurationRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property configuration for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyConfigurationRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get configuration from admin +// returns a ResourcePolicyConfigurationable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyConfigurationRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyConfigurationable), nil +} + +// GetFederatedIdentityCredentialSubjectWithAppId provides operations to call the getFederatedIdentityCredentialSubject method. +// returns a *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder when successful +func (m *ResourcePolicyConfigurationRequestBuilder) GetFederatedIdentityCredentialSubjectWithAppId(appId *string) *ResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilder { + return NewResourcePolicyConfigurationGetFederatedIdentityCredentialSubjectWithAppIdRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, appId) +} + +// Patch update the navigation property configuration in admin +// returns a ResourcePolicyConfigurationable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyConfigurationRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyConfigurationable, requestConfiguration *ResourcePolicyConfigurationRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyConfigurationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyConfigurationable), nil +} + +// ToDeleteRequestInformation delete navigation property configuration for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyConfigurationRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get configuration from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyConfigurationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyConfigurationRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property configuration in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyConfigurationRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyConfigurationable, requestConfiguration *ResourcePolicyConfigurationRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyConfigurationRequestBuilder when successful +func (m *ResourcePolicyConfigurationRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyConfigurationRequestBuilder { + return NewResourcePolicyConfigurationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_count_request_builder.go b/admin/resource_policy_definitions_count_request_builder.go new file mode 100644 index 00000000000..94bef5e2d99 --- /dev/null +++ b/admin/resource_policy_definitions_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDefinitionsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDefinitionsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDefinitionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDefinitionsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDefinitionsCountRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsCountRequestBuilder { + m := &ResourcePolicyDefinitionsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsCountRequestBuilder instantiates a new ResourcePolicyDefinitionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDefinitionsCountRequestBuilder when successful +func (m *ResourcePolicyDefinitionsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsCountRequestBuilder { + return NewResourcePolicyDefinitionsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_item_assignments_count_request_builder.go b/admin/resource_policy_definitions_item_assignments_count_request_builder.go new file mode 100644 index 00000000000..402a6cc2673 --- /dev/null +++ b/admin/resource_policy_definitions_item_assignments_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder { + m := &ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/assignments/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder instantiates a new ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder { + return NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_item_assignments_request_builder.go b/admin/resource_policy_definitions_item_assignments_request_builder.go new file mode 100644 index 00000000000..c33e2bda551 --- /dev/null +++ b/admin/resource_policy_definitions_item_assignments_request_builder.go @@ -0,0 +1,122 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsItemAssignmentsRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDefinitionsItemAssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetQueryParameters +} + +// ByResourcePolicyAssignmentUniqueName provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder) ByResourcePolicyAssignmentUniqueName(resourcePolicyAssignmentUniqueName string) *ResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyAssignmentUniqueName != "" { + urlTplParams["resourcePolicyAssignment%2DuniqueName"] = resourcePolicyAssignmentUniqueName + } + return NewResourcePolicyDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDefinitionsItemAssignmentsRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder { + m := &ResourcePolicyDefinitionsItemAssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/assignments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemAssignmentsRequestBuilder instantiates a new ResourcePolicyDefinitionsItemAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder) Count() *ResourcePolicyDefinitionsItemAssignmentsCountRequestBuilder { + return NewResourcePolicyDefinitionsItemAssignmentsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder { + return NewResourcePolicyDefinitionsItemAssignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_item_previous_versions_count_request_builder.go b/admin/resource_policy_definitions_item_previous_versions_count_request_builder.go new file mode 100644 index 00000000000..b98da2486cf --- /dev/null +++ b/admin/resource_policy_definitions_item_previous_versions_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder { + m := &ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder instantiates a new ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder { + return NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_item_previous_versions_request_builder.go b/admin/resource_policy_definitions_item_previous_versions_request_builder.go new file mode 100644 index 00000000000..de31f9d0269 --- /dev/null +++ b/admin/resource_policy_definitions_item_previous_versions_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters get previousVersions from admin +type ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters +} + +// ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyDefinitionVersionVersion provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) ByResourcePolicyDefinitionVersionVersion(resourcePolicyDefinitionVersionVersion string) *ResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyDefinitionVersionVersion != "" { + urlTplParams["resourcePolicyDefinitionVersion%2Dversion"] = resourcePolicyDefinitionVersionVersion + } + return NewResourcePolicyDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder { + m := &ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder instantiates a new ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) Count() *ResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilder { + return NewResourcePolicyDefinitionsItemPreviousVersionsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get previousVersions from admin +// returns a ResourcePolicyDefinitionVersionCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionCollectionResponseable), nil +} + +// Post create new navigation property to previousVersions for admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// ToGetRequestInformation get previousVersions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to previousVersions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder { + return NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_item_restore_request_builder.go b/admin/resource_policy_definitions_item_restore_request_builder.go new file mode 100644 index 00000000000..bddccf8c2bb --- /dev/null +++ b/admin/resource_policy_definitions_item_restore_request_builder.go @@ -0,0 +1,78 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsItemRestoreRequestBuilder provides operations to call the restore method. +type ResourcePolicyDefinitionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsItemRestoreRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsItemRestoreRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyDefinitionsItemRestoreRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemRestoreRequestBuilder { + m := &ResourcePolicyDefinitionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}/restore", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsItemRestoreRequestBuilder instantiates a new ResourcePolicyDefinitionsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsItemRestoreRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action restore +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemRestoreRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// ToPostRequestInformation invoke action restore +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsItemRestoreRequestBuilderPostRequestConfiguration) (*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") + 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. +// returns a *ResourcePolicyDefinitionsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyDefinitionsItemRestoreRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsItemRestoreRequestBuilder { + return NewResourcePolicyDefinitionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_request_builder.go b/admin/resource_policy_definitions_request_builder.go new file mode 100644 index 00000000000..3821d4bd725 --- /dev/null +++ b/admin/resource_policy_definitions_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsRequestBuilder provides operations to manage the definitions property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyDefinitionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsRequestBuilderGetQueryParameters get definitions from admin +type ResourcePolicyDefinitionsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDefinitionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsRequestBuilderGetQueryParameters +} + +// ResourcePolicyDefinitionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyDefinitionUniqueName provides operations to manage the definitions property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDefinitionsRequestBuilder) ByResourcePolicyDefinitionUniqueName(resourcePolicyDefinitionUniqueName string) *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyDefinitionUniqueName != "" { + urlTplParams["resourcePolicyDefinition%2DuniqueName"] = resourcePolicyDefinitionUniqueName + } + return NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDefinitionsRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsRequestBuilder { + m := &ResourcePolicyDefinitionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsRequestBuilder instantiates a new ResourcePolicyDefinitionsRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDefinitionsCountRequestBuilder when successful +func (m *ResourcePolicyDefinitionsRequestBuilder) Count() *ResourcePolicyDefinitionsCountRequestBuilder { + return NewResourcePolicyDefinitionsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get definitions from admin +// returns a ResourcePolicyDefinitionCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionCollectionResponseable), nil +} + +// Post create new navigation property to definitions for admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDefinitionsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// ToGetRequestInformation get definitions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to definitions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDefinitionsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyDefinitionsRequestBuilder when successful +func (m *ResourcePolicyDefinitionsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsRequestBuilder { + return NewResourcePolicyDefinitionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_definitions_resource_policy_definition_unique_name_item_request_builder.go b/admin/resource_policy_definitions_resource_policy_definition_unique_name_item_request_builder.go new file mode 100644 index 00000000000..1e32d4d88c1 --- /dev/null +++ b/admin/resource_policy_definitions_resource_policy_definition_unique_name_item_request_builder.go @@ -0,0 +1,191 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder provides operations to manage the definitions property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters get definitions from admin +type ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetQueryParameters +} + +// ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// Assignments provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Assignments() *ResourcePolicyDefinitionsItemAssignmentsRequestBuilder { + return NewResourcePolicyDefinitionsItemAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal instantiates a new ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + m := &ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/definitions/{resourcePolicyDefinition%2DuniqueName}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder instantiates a new ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder and sets the default values. +func NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property definitions for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get definitions from admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// Patch update the navigation property definitions in admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// PreviousVersions provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) PreviousVersions() *ResourcePolicyDefinitionsItemPreviousVersionsRequestBuilder { + return NewResourcePolicyDefinitionsItemPreviousVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Restore provides operations to call the restore method. +// returns a *ResourcePolicyDefinitionsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) Restore() *ResourcePolicyDefinitionsItemRestoreRequestBuilder { + return NewResourcePolicyDefinitionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToDeleteRequestInformation delete navigation property definitions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get definitions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property definitions in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + return NewResourcePolicyDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_assignments_count_request_builder.go b/admin/resource_policy_deleted_items_assignments_count_request_builder.go new file mode 100644 index 00000000000..768577abfcd --- /dev/null +++ b/admin/resource_policy_deleted_items_assignments_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder { + m := &ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/assignments/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilder instantiates a new ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_assignments_item_restore_request_builder.go b/admin/resource_policy_deleted_items_assignments_item_restore_request_builder.go new file mode 100644 index 00000000000..b6c9d8fc88c --- /dev/null +++ b/admin/resource_policy_deleted_items_assignments_item_restore_request_builder.go @@ -0,0 +1,78 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder provides operations to call the restore method. +type ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder { + m := &ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/assignments/{resourcePolicyAssignment%2DuniqueName}/restore", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder instantiates a new ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action restore +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToPostRequestInformation invoke action restore +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilderPostRequestConfiguration) (*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") + 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. +// returns a *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_assignments_request_builder.go b/admin/resource_policy_deleted_items_assignments_request_builder.go new file mode 100644 index 00000000000..1bd1c035ce9 --- /dev/null +++ b/admin/resource_policy_deleted_items_assignments_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsAssignmentsRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDeletableRoot entity. +type ResourcePolicyDeletedItemsAssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsAssignmentsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsAssignmentsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyAssignmentUniqueName provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDeletableRoot entity. +// returns a *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) ByResourcePolicyAssignmentUniqueName(resourcePolicyAssignmentUniqueName string) *ResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyAssignmentUniqueName != "" { + urlTplParams["resourcePolicyAssignment%2DuniqueName"] = resourcePolicyAssignmentUniqueName + } + return NewResourcePolicyDeletedItemsAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDeletedItemsAssignmentsRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsRequestBuilder { + m := &ResourcePolicyDeletedItemsAssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/assignments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsAssignmentsRequestBuilder instantiates a new ResourcePolicyDeletedItemsAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsAssignmentsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) Count() *ResourcePolicyDeletedItemsAssignmentsCountRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable), nil +} + +// Post create new navigation property to assignments for admin +// returns a ResourcePolicyAssignmentable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to assignments for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentable, requestConfiguration *ResourcePolicyDeletedItemsAssignmentsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyDeletedItemsAssignmentsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsAssignmentsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsAssignmentsRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_count_request_builder.go b/admin/resource_policy_deleted_items_definitions_count_request_builder.go new file mode 100644 index 00000000000..5075d971d26 --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_item_assignments_count_request_builder.go b/admin/resource_policy_deleted_items_definitions_item_assignments_count_request_builder.go new file mode 100644 index 00000000000..424fbabcca5 --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_item_assignments_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/assignments/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_item_assignments_request_builder.go b/admin/resource_policy_deleted_items_definitions_item_assignments_request_builder.go new file mode 100644 index 00000000000..29cbf8e6271 --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_item_assignments_request_builder.go @@ -0,0 +1,122 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetQueryParameters get assignments from admin +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetQueryParameters +} + +// ByResourcePolicyAssignmentUniqueName provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder) ByResourcePolicyAssignmentUniqueName(resourcePolicyAssignmentUniqueName string) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyAssignmentUniqueName != "" { + urlTplParams["resourcePolicyAssignment%2DuniqueName"] = resourcePolicyAssignmentUniqueName + } + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsResourcePolicyAssignmentUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/assignments{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder) Count() *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get assignments from admin +// returns a ResourcePolicyAssignmentCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyAssignmentCollectionResponseable), nil +} + +// ToGetRequestInformation get assignments from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemAssignmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_item_previous_versions_count_request_builder.go b/admin/resource_policy_deleted_items_definitions_item_previous_versions_count_request_builder.go new file mode 100644 index 00000000000..b4d58d23c64 --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_item_previous_versions_count_request_builder.go @@ -0,0 +1,90 @@ +// 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" +) + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_item_previous_versions_request_builder.go b/admin/resource_policy_deleted_items_definitions_item_previous_versions_request_builder.go new file mode 100644 index 00000000000..212cda58239 --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_item_previous_versions_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters get previousVersions from admin +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyDefinitionVersionVersion provides operations to manage the previousVersions property of the microsoft.graph.resourcePolicyDefinition entity. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) ByResourcePolicyDefinitionVersionVersion(resourcePolicyDefinitionVersionVersion string) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyDefinitionVersionVersion != "" { + urlTplParams["resourcePolicyDefinitionVersion%2Dversion"] = resourcePolicyDefinitionVersionVersion + } + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsResourcePolicyDefinitionVersionVersionItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/previousVersions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) Count() *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get previousVersions from admin +// returns a ResourcePolicyDefinitionVersionCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionCollectionResponseable), nil +} + +// Post create new navigation property to previousVersions for admin +// returns a ResourcePolicyDefinitionVersionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable), nil +} + +// ToGetRequestInformation get previousVersions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to previousVersions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionVersionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemPreviousVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_item_restore_request_builder.go b/admin/resource_policy_deleted_items_definitions_item_restore_request_builder.go new file mode 100644 index 00000000000..ec62c32d15b --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_item_restore_request_builder.go @@ -0,0 +1,78 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder provides operations to call the restore method. +type ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions/{resourcePolicyDefinition%2DuniqueName}/restore", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action restore +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// ToPostRequestInformation invoke action restore +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilderPostRequestConfiguration) (*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") + 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. +// returns a *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_definitions_request_builder.go b/admin/resource_policy_deleted_items_definitions_request_builder.go new file mode 100644 index 00000000000..3b8114bc5db --- /dev/null +++ b/admin/resource_policy_deleted_items_definitions_request_builder.go @@ -0,0 +1,167 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsDefinitionsRequestBuilder provides operations to manage the definitions property of the microsoft.graph.resourcePolicyDeletableRoot entity. +type ResourcePolicyDeletedItemsDefinitionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetQueryParameters get definitions from admin +type ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsDefinitionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsDefinitionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByResourcePolicyDefinitionUniqueName provides operations to manage the definitions property of the microsoft.graph.resourcePolicyDeletableRoot entity. +// returns a *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) ByResourcePolicyDefinitionUniqueName(resourcePolicyDefinitionUniqueName string) *ResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyDefinitionUniqueName != "" { + urlTplParams["resourcePolicyDefinition%2DuniqueName"] = resourcePolicyDefinitionUniqueName + } + return NewResourcePolicyDeletedItemsDefinitionsResourcePolicyDefinitionUniqueNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDeletedItemsDefinitionsRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsDefinitionsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsRequestBuilder { + m := &ResourcePolicyDeletedItemsDefinitionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems/definitions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsDefinitionsRequestBuilder instantiates a new ResourcePolicyDeletedItemsDefinitionsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsDefinitionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsDefinitionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsDefinitionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) Count() *ResourcePolicyDeletedItemsDefinitionsCountRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get definitions from admin +// returns a ResourcePolicyDefinitionCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionCollectionResponseable), nil +} + +// Post create new navigation property to definitions for admin +// returns a ResourcePolicyDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable), nil +} + +// ToGetRequestInformation get definitions from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to definitions for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDefinitionable, requestConfiguration *ResourcePolicyDeletedItemsDefinitionsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyDeletedItemsDefinitionsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsDefinitionsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsDefinitionsRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_deleted_items_request_builder.go b/admin/resource_policy_deleted_items_request_builder.go new file mode 100644 index 00000000000..d6a2ae56997 --- /dev/null +++ b/admin/resource_policy_deleted_items_request_builder.go @@ -0,0 +1,185 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyDeletedItemsRequestBuilder provides operations to manage the deletedItems property of the microsoft.graph.resourcePolicyRoot entity. +type ResourcePolicyDeletedItemsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyDeletedItemsRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyDeletedItemsRequestBuilderGetQueryParameters get deletedItems from admin +type ResourcePolicyDeletedItemsRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyDeletedItemsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyDeletedItemsRequestBuilderGetQueryParameters +} + +// ResourcePolicyDeletedItemsRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyDeletedItemsRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// Assignments provides operations to manage the assignments property of the microsoft.graph.resourcePolicyDeletableRoot entity. +// returns a *ResourcePolicyDeletedItemsAssignmentsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsRequestBuilder) Assignments() *ResourcePolicyDeletedItemsAssignmentsRequestBuilder { + return NewResourcePolicyDeletedItemsAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyDeletedItemsRequestBuilderInternal instantiates a new ResourcePolicyDeletedItemsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsRequestBuilder { + m := &ResourcePolicyDeletedItemsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/deletedItems{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyDeletedItemsRequestBuilder instantiates a new ResourcePolicyDeletedItemsRequestBuilder and sets the default values. +func NewResourcePolicyDeletedItemsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyDeletedItemsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyDeletedItemsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Definitions provides operations to manage the definitions property of the microsoft.graph.resourcePolicyDeletableRoot entity. +// returns a *ResourcePolicyDeletedItemsDefinitionsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsRequestBuilder) Definitions() *ResourcePolicyDeletedItemsDefinitionsRequestBuilder { + return NewResourcePolicyDeletedItemsDefinitionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Delete delete navigation property deletedItems for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get deletedItems from admin +// returns a ResourcePolicyDeletableRootable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDeletableRootable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDeletableRootFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDeletableRootable), nil +} + +// Patch update the navigation property deletedItems in admin +// returns a ResourcePolicyDeletableRootable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyDeletedItemsRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDeletableRootable, requestConfiguration *ResourcePolicyDeletedItemsRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDeletableRootable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyDeletableRootFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDeletableRootable), nil +} + +// ToDeleteRequestInformation delete navigation property deletedItems for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get deletedItems from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyDeletedItemsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property deletedItems in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyDeletedItemsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyDeletableRootable, requestConfiguration *ResourcePolicyDeletedItemsRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyDeletedItemsRequestBuilder when successful +func (m *ResourcePolicyDeletedItemsRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyDeletedItemsRequestBuilder { + return NewResourcePolicyDeletedItemsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_evaluate_assigned_policies_post_request_body.go b/admin/resource_policy_evaluate_assigned_policies_post_request_body.go new file mode 100644 index 00000000000..87e3a66b50e --- /dev/null +++ b/admin/resource_policy_evaluate_assigned_policies_post_request_body.go @@ -0,0 +1,327 @@ +// 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 ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ResourcePolicyEvaluateAssignedPoliciesPostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyEvaluateAssignedPoliciesPostRequestBody instantiates a new ResourcePolicyEvaluateAssignedPoliciesPostRequestBody and sets the default values. +func NewResourcePolicyEvaluateAssignedPoliciesPostRequestBody() *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody { + m := &ResourcePolicyEvaluateAssignedPoliciesPostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + includeNormalizedRequestInputValue := false + m.SetIncludeNormalizedRequestInput(&includeNormalizedRequestInputValue) + isResultDetailedValue := false + m.SetIsResultDetailed(&isResultDetailedValue) + return m +} + +// CreateResourcePolicyEvaluateAssignedPoliciesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyEvaluateAssignedPoliciesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyEvaluateAssignedPoliciesPostRequestBody(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["httpMethod"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ParseRequestHttpMethod) + if err != nil { + return err + } + if val != nil { + m.SetHttpMethod(val.(*ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod)) + } + return nil + } + res["includeNormalizedRequestInput"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncludeNormalizedRequestInput(val) + } + return nil + } + res["isResultDetailed"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsResultDetailed(val) + } + return nil + } + res["resourceBody"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResourceBody(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["resourceUri"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResourceUri(val) + } + return nil + } + res["scope"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScope(val) + } + return nil + } + return res +} + +// GetHttpMethod gets the httpMethod property value. The httpMethod property +// returns a *RequestHttpMethod when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetHttpMethod() *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod { + val, err := m.GetBackingStore().Get("httpMethod") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod) + } + return nil +} + +// GetIncludeNormalizedRequestInput gets the includeNormalizedRequestInput property value. The includeNormalizedRequestInput property +// returns a *bool when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetIncludeNormalizedRequestInput() *bool { + val, err := m.GetBackingStore().Get("includeNormalizedRequestInput") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetIsResultDetailed gets the isResultDetailed property value. The isResultDetailed property +// returns a *bool when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetIsResultDetailed() *bool { + val, err := m.GetBackingStore().Get("isResultDetailed") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetResourceBody gets the resourceBody property value. The resourceBody property +// returns a UntypedNodeable when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetResourceBody() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("resourceBody") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetResourceUri gets the resourceUri property value. The resourceUri property +// returns a *string when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetResourceUri() *string { + val, err := m.GetBackingStore().Get("resourceUri") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetScope gets the scope property value. The scope property +// returns a *string when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) GetScope() *string { + val, err := m.GetBackingStore().Get("scope") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetHttpMethod() != nil { + cast := (*m.GetHttpMethod()).String() + err := writer.WriteStringValue("httpMethod", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("includeNormalizedRequestInput", m.GetIncludeNormalizedRequestInput()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isResultDetailed", m.GetIsResultDetailed()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resourceBody", m.GetResourceBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resourceUri", m.GetResourceUri()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("scope", m.GetScope()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetHttpMethod sets the httpMethod property value. The httpMethod property +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetHttpMethod(value *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod) { + err := m.GetBackingStore().Set("httpMethod", value) + if err != nil { + panic(err) + } +} + +// SetIncludeNormalizedRequestInput sets the includeNormalizedRequestInput property value. The includeNormalizedRequestInput property +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetIncludeNormalizedRequestInput(value *bool) { + err := m.GetBackingStore().Set("includeNormalizedRequestInput", value) + if err != nil { + panic(err) + } +} + +// SetIsResultDetailed sets the isResultDetailed property value. The isResultDetailed property +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetIsResultDetailed(value *bool) { + err := m.GetBackingStore().Set("isResultDetailed", value) + if err != nil { + panic(err) + } +} + +// SetResourceBody sets the resourceBody property value. The resourceBody property +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetResourceBody(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("resourceBody", value) + if err != nil { + panic(err) + } +} + +// SetResourceUri sets the resourceUri property value. The resourceUri property +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetResourceUri(value *string) { + err := m.GetBackingStore().Set("resourceUri", value) + if err != nil { + panic(err) + } +} + +// SetScope sets the scope property value. The scope property +func (m *ResourcePolicyEvaluateAssignedPoliciesPostRequestBody) SetScope(value *string) { + err := m.GetBackingStore().Set("scope", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyEvaluateAssignedPoliciesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetHttpMethod() *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod + GetIncludeNormalizedRequestInput() *bool + GetIsResultDetailed() *bool + GetResourceBody() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetResourceUri() *string + GetScope() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetHttpMethod(value *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod) + SetIncludeNormalizedRequestInput(value *bool) + SetIsResultDetailed(value *bool) + SetResourceBody(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetResourceUri(value *string) + SetScope(value *string) +} diff --git a/admin/resource_policy_evaluate_assigned_policies_request_builder.go b/admin/resource_policy_evaluate_assigned_policies_request_builder.go new file mode 100644 index 00000000000..2a1bc95c678 --- /dev/null +++ b/admin/resource_policy_evaluate_assigned_policies_request_builder.go @@ -0,0 +1,82 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyEvaluateAssignedPoliciesRequestBuilder provides operations to call the evaluateAssignedPolicies method. +type ResourcePolicyEvaluateAssignedPoliciesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyEvaluateAssignedPoliciesRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyEvaluateAssignedPoliciesRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyEvaluateAssignedPoliciesRequestBuilderInternal instantiates a new ResourcePolicyEvaluateAssignedPoliciesRequestBuilder and sets the default values. +func NewResourcePolicyEvaluateAssignedPoliciesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder { + m := &ResourcePolicyEvaluateAssignedPoliciesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/evaluateAssignedPolicies", pathParameters), + } + return m +} + +// NewResourcePolicyEvaluateAssignedPoliciesRequestBuilder instantiates a new ResourcePolicyEvaluateAssignedPoliciesRequestBuilder and sets the default values. +func NewResourcePolicyEvaluateAssignedPoliciesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyEvaluateAssignedPoliciesRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action evaluateAssignedPolicies +// returns a PoliciesEvaluationResultable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder) Post(ctx context.Context, body ResourcePolicyEvaluateAssignedPoliciesPostRequestBodyable, requestConfiguration *ResourcePolicyEvaluateAssignedPoliciesRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PoliciesEvaluationResultable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreatePoliciesEvaluationResultFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PoliciesEvaluationResultable), nil +} + +// ToPostRequestInformation invoke action evaluateAssignedPolicies +// returns a *RequestInformation when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ResourcePolicyEvaluateAssignedPoliciesPostRequestBodyable, requestConfiguration *ResourcePolicyEvaluateAssignedPoliciesRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder when successful +func (m *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder { + return NewResourcePolicyEvaluateAssignedPoliciesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_evaluate_policy_post_request_body.go b/admin/resource_policy_evaluate_policy_post_request_body.go new file mode 100644 index 00000000000..8e7588c797c --- /dev/null +++ b/admin/resource_policy_evaluate_policy_post_request_body.go @@ -0,0 +1,496 @@ +// 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 ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ResourcePolicyEvaluatePolicyPostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyEvaluatePolicyPostRequestBody instantiates a new ResourcePolicyEvaluatePolicyPostRequestBody and sets the default values. +func NewResourcePolicyEvaluatePolicyPostRequestBody() *ResourcePolicyEvaluatePolicyPostRequestBody { + m := &ResourcePolicyEvaluatePolicyPostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + includeNormalizedRequestInputValue := false + m.SetIncludeNormalizedRequestInput(&includeNormalizedRequestInputValue) + isResultDetailedValue := false + m.SetIsResultDetailed(&isResultDetailedValue) + return m +} + +// CreateResourcePolicyEvaluatePolicyPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyEvaluatePolicyPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyEvaluatePolicyPostRequestBody(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetEnforcementMode gets the enforcementMode property value. The enforcementMode property +// returns a *EnforcementMode when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetEnforcementMode() *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EnforcementMode { + val, err := m.GetBackingStore().Get("enforcementMode") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EnforcementMode) + } + return nil +} + +// GetFetchResponses gets the fetchResponses property value. The fetchResponses property +// returns a []FetchResponseable when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetFetchResponses() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable { + val, err := m.GetBackingStore().Get("fetchResponses") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["enforcementMode"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ParseEnforcementMode) + if err != nil { + return err + } + if val != nil { + m.SetEnforcementMode(val.(*ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EnforcementMode)) + } + return nil + } + res["fetchResponses"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateFetchResponseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable) + } + } + m.SetFetchResponses(res) + } + return nil + } + res["httpMethod"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ParseRequestHttpMethod) + if err != nil { + return err + } + if val != nil { + m.SetHttpMethod(val.(*ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod)) + } + return nil + } + res["includeNormalizedRequestInput"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncludeNormalizedRequestInput(val) + } + return nil + } + res["isResultDetailed"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsResultDetailed(val) + } + return nil + } + res["params"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParams(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["policy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicy(val) + } + return nil + } + res["resourceBody"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResourceBody(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["resourceUri"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResourceUri(val) + } + return nil + } + res["scope"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScope(val) + } + return nil + } + return res +} + +// GetHttpMethod gets the httpMethod property value. The httpMethod property +// returns a *RequestHttpMethod when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetHttpMethod() *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod { + val, err := m.GetBackingStore().Get("httpMethod") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod) + } + return nil +} + +// GetIncludeNormalizedRequestInput gets the includeNormalizedRequestInput property value. The includeNormalizedRequestInput property +// returns a *bool when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetIncludeNormalizedRequestInput() *bool { + val, err := m.GetBackingStore().Get("includeNormalizedRequestInput") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetIsResultDetailed gets the isResultDetailed property value. The isResultDetailed property +// returns a *bool when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetIsResultDetailed() *bool { + val, err := m.GetBackingStore().Get("isResultDetailed") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetParams gets the params property value. The params property +// returns a UntypedNodeable when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetParams() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("params") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetPolicy gets the policy property value. The policy property +// returns a *string when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetPolicy() *string { + val, err := m.GetBackingStore().Get("policy") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetResourceBody gets the resourceBody property value. The resourceBody property +// returns a UntypedNodeable when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetResourceBody() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("resourceBody") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetResourceUri gets the resourceUri property value. The resourceUri property +// returns a *string when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetResourceUri() *string { + val, err := m.GetBackingStore().Get("resourceUri") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetScope gets the scope property value. The scope property +// returns a *string when successful +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) GetScope() *string { + val, err := m.GetBackingStore().Get("scope") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetEnforcementMode() != nil { + cast := (*m.GetEnforcementMode()).String() + err := writer.WriteStringValue("enforcementMode", &cast) + if err != nil { + return err + } + } + if m.GetFetchResponses() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFetchResponses())) + for i, v := range m.GetFetchResponses() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("fetchResponses", cast) + if err != nil { + return err + } + } + if m.GetHttpMethod() != nil { + cast := (*m.GetHttpMethod()).String() + err := writer.WriteStringValue("httpMethod", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("includeNormalizedRequestInput", m.GetIncludeNormalizedRequestInput()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isResultDetailed", m.GetIsResultDetailed()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("params", m.GetParams()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("policy", m.GetPolicy()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resourceBody", m.GetResourceBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resourceUri", m.GetResourceUri()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("scope", m.GetScope()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetEnforcementMode sets the enforcementMode property value. The enforcementMode property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetEnforcementMode(value *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EnforcementMode) { + err := m.GetBackingStore().Set("enforcementMode", value) + if err != nil { + panic(err) + } +} + +// SetFetchResponses sets the fetchResponses property value. The fetchResponses property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetFetchResponses(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable) { + err := m.GetBackingStore().Set("fetchResponses", value) + if err != nil { + panic(err) + } +} + +// SetHttpMethod sets the httpMethod property value. The httpMethod property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetHttpMethod(value *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod) { + err := m.GetBackingStore().Set("httpMethod", value) + if err != nil { + panic(err) + } +} + +// SetIncludeNormalizedRequestInput sets the includeNormalizedRequestInput property value. The includeNormalizedRequestInput property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetIncludeNormalizedRequestInput(value *bool) { + err := m.GetBackingStore().Set("includeNormalizedRequestInput", value) + if err != nil { + panic(err) + } +} + +// SetIsResultDetailed sets the isResultDetailed property value. The isResultDetailed property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetIsResultDetailed(value *bool) { + err := m.GetBackingStore().Set("isResultDetailed", value) + if err != nil { + panic(err) + } +} + +// SetParams sets the params property value. The params property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetParams(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("params", value) + if err != nil { + panic(err) + } +} + +// SetPolicy sets the policy property value. The policy property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetPolicy(value *string) { + err := m.GetBackingStore().Set("policy", value) + if err != nil { + panic(err) + } +} + +// SetResourceBody sets the resourceBody property value. The resourceBody property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetResourceBody(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("resourceBody", value) + if err != nil { + panic(err) + } +} + +// SetResourceUri sets the resourceUri property value. The resourceUri property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetResourceUri(value *string) { + err := m.GetBackingStore().Set("resourceUri", value) + if err != nil { + panic(err) + } +} + +// SetScope sets the scope property value. The scope property +func (m *ResourcePolicyEvaluatePolicyPostRequestBody) SetScope(value *string) { + err := m.GetBackingStore().Set("scope", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyEvaluatePolicyPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetEnforcementMode() *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EnforcementMode + GetFetchResponses() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable + GetHttpMethod() *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod + GetIncludeNormalizedRequestInput() *bool + GetIsResultDetailed() *bool + GetParams() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetPolicy() *string + GetResourceBody() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetResourceUri() *string + GetScope() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetEnforcementMode(value *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.EnforcementMode) + SetFetchResponses(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.FetchResponseable) + SetHttpMethod(value *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.RequestHttpMethod) + SetIncludeNormalizedRequestInput(value *bool) + SetIsResultDetailed(value *bool) + SetParams(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetPolicy(value *string) + SetResourceBody(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetResourceUri(value *string) + SetScope(value *string) +} diff --git a/admin/resource_policy_evaluate_policy_request_builder.go b/admin/resource_policy_evaluate_policy_request_builder.go new file mode 100644 index 00000000000..91635ca6b2f --- /dev/null +++ b/admin/resource_policy_evaluate_policy_request_builder.go @@ -0,0 +1,82 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyEvaluatePolicyRequestBuilder provides operations to call the evaluatePolicy method. +type ResourcePolicyEvaluatePolicyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyEvaluatePolicyRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyEvaluatePolicyRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewResourcePolicyEvaluatePolicyRequestBuilderInternal instantiates a new ResourcePolicyEvaluatePolicyRequestBuilder and sets the default values. +func NewResourcePolicyEvaluatePolicyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyEvaluatePolicyRequestBuilder { + m := &ResourcePolicyEvaluatePolicyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy/evaluatePolicy", pathParameters), + } + return m +} + +// NewResourcePolicyEvaluatePolicyRequestBuilder instantiates a new ResourcePolicyEvaluatePolicyRequestBuilder and sets the default values. +func NewResourcePolicyEvaluatePolicyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyEvaluatePolicyRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyEvaluatePolicyRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post invoke action evaluatePolicy +// returns a PoliciesEvaluationResultable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyEvaluatePolicyRequestBuilder) Post(ctx context.Context, body ResourcePolicyEvaluatePolicyPostRequestBodyable, requestConfiguration *ResourcePolicyEvaluatePolicyRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PoliciesEvaluationResultable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreatePoliciesEvaluationResultFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PoliciesEvaluationResultable), nil +} + +// ToPostRequestInformation invoke action evaluatePolicy +// returns a *RequestInformation when successful +func (m *ResourcePolicyEvaluatePolicyRequestBuilder) ToPostRequestInformation(ctx context.Context, body ResourcePolicyEvaluatePolicyPostRequestBodyable, requestConfiguration *ResourcePolicyEvaluatePolicyRequestBuilderPostRequestConfiguration) (*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. +// returns a *ResourcePolicyEvaluatePolicyRequestBuilder when successful +func (m *ResourcePolicyEvaluatePolicyRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyEvaluatePolicyRequestBuilder { + return NewResourcePolicyEvaluatePolicyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/admin/resource_policy_request_builder.go b/admin/resource_policy_request_builder.go new file mode 100644 index 00000000000..d025fd6fe65 --- /dev/null +++ b/admin/resource_policy_request_builder.go @@ -0,0 +1,215 @@ +// 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" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyRequestBuilder provides operations to manage the resourcePolicy property of the microsoft.graph.admin entity. +type ResourcePolicyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ResourcePolicyRequestBuilderGetQueryParameters get resourcePolicy from admin +type ResourcePolicyRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyRequestBuilderGetQueryParameters +} + +// ResourcePolicyRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// Assignments provides operations to manage the assignments property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyAssignmentsRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) Assignments() *ResourcePolicyAssignmentsRequestBuilder { + return NewResourcePolicyAssignmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// BuiltInDefinitions provides operations to manage the builtInDefinitions property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyBuiltInDefinitionsRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) BuiltInDefinitions() *ResourcePolicyBuiltInDefinitionsRequestBuilder { + return NewResourcePolicyBuiltInDefinitionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Configuration provides operations to manage the configuration property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyConfigurationRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) Configuration() *ResourcePolicyConfigurationRequestBuilder { + return NewResourcePolicyConfigurationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyRequestBuilderInternal instantiates a new ResourcePolicyRequestBuilder and sets the default values. +func NewResourcePolicyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyRequestBuilder { + m := &ResourcePolicyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/resourcePolicy{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyRequestBuilder instantiates a new ResourcePolicyRequestBuilder and sets the default values. +func NewResourcePolicyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyRequestBuilderInternal(urlParams, requestAdapter) +} + +// Definitions provides operations to manage the definitions property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyDefinitionsRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) Definitions() *ResourcePolicyDefinitionsRequestBuilder { + return NewResourcePolicyDefinitionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Delete delete navigation property resourcePolicy for admin +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyRequestBuilder) Delete(ctx context.Context, requestConfiguration *ResourcePolicyRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// DeletedItems provides operations to manage the deletedItems property of the microsoft.graph.resourcePolicyRoot entity. +// returns a *ResourcePolicyDeletedItemsRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) DeletedItems() *ResourcePolicyDeletedItemsRequestBuilder { + return NewResourcePolicyDeletedItemsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// EvaluateAssignedPolicies provides operations to call the evaluateAssignedPolicies method. +// returns a *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) EvaluateAssignedPolicies() *ResourcePolicyEvaluateAssignedPoliciesRequestBuilder { + return NewResourcePolicyEvaluateAssignedPoliciesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// EvaluatePolicy provides operations to call the evaluatePolicy method. +// returns a *ResourcePolicyEvaluatePolicyRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) EvaluatePolicy() *ResourcePolicyEvaluatePolicyRequestBuilder { + return NewResourcePolicyEvaluatePolicyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get resourcePolicy from admin +// returns a ResourcePolicyRootable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyRootable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyRootFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyRootable), nil +} + +// Patch update the navigation property resourcePolicy in admin +// returns a ResourcePolicyRootable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyRootable, requestConfiguration *ResourcePolicyRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyRootable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyRootFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyRootable), nil +} + +// ToDeleteRequestInformation delete navigation property resourcePolicy for admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get resourcePolicy from admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property resourcePolicy in admin +// returns a *RequestInformation when successful +func (m *ResourcePolicyRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyRootable, requestConfiguration *ResourcePolicyRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ResourcePolicyRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyRequestBuilder { + return NewResourcePolicyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/administrativeunits/item_restore_request_builder.go b/administrativeunits/item_restore_request_builder.go index e5644114444..c36db5f4fd8 100644 --- a/administrativeunits/item_restore_request_builder.go +++ b/administrativeunits/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/applications/item_restore_request_builder.go b/applications/item_restore_request_builder.go index f00f8059144..605b4264e79 100644 --- a/applications/item_restore_request_builder.go +++ b/applications/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/auditlogs/audit_logs_request_builder.go b/auditlogs/audit_logs_request_builder.go index 373a72d7fa5..851ba86a9ed 100644 --- a/auditlogs/audit_logs_request_builder.go +++ b/auditlogs/audit_logs_request_builder.go @@ -146,6 +146,12 @@ func (m *AuditLogsRequestBuilder) Provisioning() *ProvisioningRequestBuilder { return NewProvisioningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// ResourcePolicy provides operations to manage the resourcePolicy property of the microsoft.graph.auditLogRoot entity. +// returns a *ResourcePolicyRequestBuilder when successful +func (m *AuditLogsRequestBuilder) ResourcePolicy() *ResourcePolicyRequestBuilder { + return NewResourcePolicyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // SignInEventsAppSummary provides operations to manage the signInEventsAppSummary property of the microsoft.graph.auditLogRoot entity. // returns a *SignInEventsAppSummaryRequestBuilder when successful func (m *AuditLogsRequestBuilder) SignInEventsAppSummary() *SignInEventsAppSummaryRequestBuilder { diff --git a/auditlogs/resource_policy_count_request_builder.go b/auditlogs/resource_policy_count_request_builder.go new file mode 100644 index 00000000000..51232ef8d27 --- /dev/null +++ b/auditlogs/resource_policy_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package auditlogs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyCountRequestBuilder provides operations to count the resources in the collection. +type ResourcePolicyCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyCountRequestBuilderGetQueryParameters get the number of the resource +type ResourcePolicyCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ResourcePolicyCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyCountRequestBuilderGetQueryParameters +} + +// NewResourcePolicyCountRequestBuilderInternal instantiates a new ResourcePolicyCountRequestBuilder and sets the default values. +func NewResourcePolicyCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyCountRequestBuilder { + m := &ResourcePolicyCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/auditLogs/resourcePolicy/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewResourcePolicyCountRequestBuilder instantiates a new ResourcePolicyCountRequestBuilder and sets the default values. +func NewResourcePolicyCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ResourcePolicyCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ResourcePolicyCountRequestBuilder when successful +func (m *ResourcePolicyCountRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyCountRequestBuilder { + return NewResourcePolicyCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/auditlogs/resource_policy_request_builder.go b/auditlogs/resource_policy_request_builder.go new file mode 100644 index 00000000000..4b4739b25c3 --- /dev/null +++ b/auditlogs/resource_policy_request_builder.go @@ -0,0 +1,122 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package auditlogs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyRequestBuilder provides operations to manage the resourcePolicy property of the microsoft.graph.auditLogRoot entity. +type ResourcePolicyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyRequestBuilderGetQueryParameters get resourcePolicy from auditLogs +type ResourcePolicyRequestBuilderGetQueryParameters 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\"" +} + +// ResourcePolicyRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyRequestBuilderGetQueryParameters +} + +// ByResourcePolicyEvaluationEventId provides operations to manage the resourcePolicy property of the microsoft.graph.auditLogRoot entity. +// returns a *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) ByResourcePolicyEvaluationEventId(resourcePolicyEvaluationEventId string) *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if resourcePolicyEvaluationEventId != "" { + urlTplParams["resourcePolicyEvaluationEvent%2Did"] = resourcePolicyEvaluationEventId + } + return NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewResourcePolicyRequestBuilderInternal instantiates a new ResourcePolicyRequestBuilder and sets the default values. +func NewResourcePolicyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyRequestBuilder { + m := &ResourcePolicyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/auditLogs/resourcePolicy{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewResourcePolicyRequestBuilder instantiates a new ResourcePolicyRequestBuilder and sets the default values. +func NewResourcePolicyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ResourcePolicyCountRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) Count() *ResourcePolicyCountRequestBuilder { + return NewResourcePolicyCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get resourcePolicy from auditLogs +// returns a ResourcePolicyEvaluationEventCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyEvaluationEventCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyEvaluationEventCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyEvaluationEventCollectionResponseable), nil +} + +// ToGetRequestInformation get resourcePolicy from auditLogs +// returns a *RequestInformation when successful +func (m *ResourcePolicyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyRequestBuilder when successful +func (m *ResourcePolicyRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyRequestBuilder { + return NewResourcePolicyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/auditlogs/resource_policy_resource_policy_evaluation_event_item_request_builder.go b/auditlogs/resource_policy_resource_policy_evaluation_event_item_request_builder.go new file mode 100644 index 00000000000..5f445e11ceb --- /dev/null +++ b/auditlogs/resource_policy_resource_policy_evaluation_event_item_request_builder.go @@ -0,0 +1,91 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package auditlogs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder provides operations to manage the resourcePolicy property of the microsoft.graph.auditLogRoot entity. +type ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetQueryParameters get resourcePolicy from auditLogs +type ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetQueryParameters +} + +// NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderInternal instantiates a new ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder and sets the default values. +func NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder { + m := &ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/auditLogs/resourcePolicy/{resourcePolicyEvaluationEvent%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder instantiates a new ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder and sets the default values. +func NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get resourcePolicy from auditLogs +// returns a ResourcePolicyEvaluationEventable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyEvaluationEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateResourcePolicyEvaluationEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ResourcePolicyEvaluationEventable), nil +} + +// ToGetRequestInformation get resourcePolicy from auditLogs +// returns a *RequestInformation when successful +func (m *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder when successful +func (m *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder) WithUrl(rawUrl string) *ResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder { + return NewResourcePolicyResourcePolicyEvaluationEventItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/contacts/item_restore_request_builder.go b/contacts/item_restore_request_builder.go index 9f0ee785b79..b60d9d7bb42 100644 --- a/contacts/item_restore_request_builder.go +++ b/contacts/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/contracts/item_restore_request_builder.go b/contracts/item_restore_request_builder.go index 1053f23e1c3..0607ed7df85 100644 --- a/contracts/item_restore_request_builder.go +++ b/contracts/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/devicemanagement/virtual_endpoint_cloud_p_cs_cloud_p_c_item_request_builder.go b/devicemanagement/virtual_endpoint_cloud_p_cs_cloud_p_c_item_request_builder.go index caf5124e7fc..b2399f53df2 100644 --- a/devicemanagement/virtual_endpoint_cloud_p_cs_cloud_p_c_item_request_builder.go +++ b/devicemanagement/virtual_endpoint_cloud_p_cs_cloud_p_c_item_request_builder.go @@ -228,6 +228,18 @@ func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) RetrieveCloudPCRemote return NewVirtualEndpointCloudPCsItemRetrieveCloudPCRemoteActionResultsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// RetrieveFlexCloudPcAccessConfiguration provides operations to call the retrieveFlexCloudPcAccessConfiguration method. +// returns a *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder when successful +func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) RetrieveFlexCloudPcAccessConfiguration() *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + return NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// RetrieveFlexCloudPcConfigurationDetail provides operations to call the retrieveFlexCloudPcConfigurationDetail method. +// returns a *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder when successful +func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) RetrieveFlexCloudPcConfigurationDetail() *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + return NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // RetrieveFrontlineCloudPcDetail provides operations to call the retrieveFrontlineCloudPcDetail method. // returns a *VirtualEndpointCloudPCsItemRetrieveFrontlineCloudPcDetailRequestBuilder when successful func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) RetrieveFrontlineCloudPcDetail() *VirtualEndpointCloudPCsItemRetrieveFrontlineCloudPcDetailRequestBuilder { @@ -252,6 +264,12 @@ func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) RetryPartnerAgentInst return NewVirtualEndpointCloudPCsItemRetryPartnerAgentInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// SetDeviceName provides operations to call the setDeviceName method. +// returns a *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder when successful +func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) SetDeviceName() *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder { + return NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // SetReviewStatus provides operations to call the setReviewStatus method. // returns a *VirtualEndpointCloudPCsItemSetReviewStatusRequestBuilder when successful func (m *VirtualEndpointCloudPCsCloudPCItemRequestBuilder) SetReviewStatus() *VirtualEndpointCloudPCsItemSetReviewStatusRequestBuilder { diff --git a/devicemanagement/virtual_endpoint_cloud_p_cs_item_retrieve_flex_cloud_pc_access_configuration_request_builder.go b/devicemanagement/virtual_endpoint_cloud_p_cs_item_retrieve_flex_cloud_pc_access_configuration_request_builder.go new file mode 100644 index 00000000000..4d745cc0ee3 --- /dev/null +++ b/devicemanagement/virtual_endpoint_cloud_p_cs_item_retrieve_flex_cloud_pc_access_configuration_request_builder.go @@ -0,0 +1,81 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package devicemanagement + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder provides operations to call the retrieveFlexCloudPcAccessConfiguration method. +type VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal instantiates a new VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder and sets the default values. +func NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + m := &VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/cloudPCs/{cloudPC%2Did}/retrieveFlexCloudPcAccessConfiguration()", pathParameters), + } + return m +} + +// NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder instantiates a new VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder and sets the default values. +func NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the current access configuration of a Windows 365 Flex (formerly Windows 365 Frontline) Cloud PC. The cloudPcFlexAccessConfiguration response contains the live accessState of the Cloud PC. Use the /me endpoint to retrieve the access configuration of a Cloud PC that belongs to the signed-in user. An administrator or application can use the /deviceManagement/virtualEndpoint endpoint to retrieve the access configuration of a targeted Cloud PC. +// returns a CloudPcFlexAccessConfigurationable 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/cloudpc-retrieveflexcloudpcaccessconfiguration?view=graph-rest-beta +func (m *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder) Get(ctx context.Context, requestConfiguration *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexAccessConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateCloudPcFlexAccessConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexAccessConfigurationable), nil +} + +// ToGetRequestInformation get the current access configuration of a Windows 365 Flex (formerly Windows 365 Frontline) Cloud PC. The cloudPcFlexAccessConfiguration response contains the live accessState of the Cloud PC. Use the /me endpoint to retrieve the access configuration of a Cloud PC that belongs to the signed-in user. An administrator or application can use the /deviceManagement/virtualEndpoint endpoint to retrieve the access configuration of a targeted Cloud PC. +// returns a *RequestInformation when successful +func (m *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder when successful +func (m *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder) WithUrl(rawUrl string) *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + return NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/devicemanagement/virtual_endpoint_cloud_p_cs_item_retrieve_flex_cloud_pc_configuration_detail_request_builder.go b/devicemanagement/virtual_endpoint_cloud_p_cs_item_retrieve_flex_cloud_pc_configuration_detail_request_builder.go new file mode 100644 index 00000000000..78639b48a29 --- /dev/null +++ b/devicemanagement/virtual_endpoint_cloud_p_cs_item_retrieve_flex_cloud_pc_configuration_detail_request_builder.go @@ -0,0 +1,81 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package devicemanagement + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder provides operations to call the retrieveFlexCloudPcConfigurationDetail method. +type VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal instantiates a new VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder and sets the default values. +func NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + m := &VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/cloudPCs/{cloudPC%2Did}/retrieveFlexCloudPcConfigurationDetail()", pathParameters), + } + return m +} + +// NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder instantiates a new VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder and sets the default values. +func NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get Windows 365 Flex (formerly Windows 365 Frontline) configuration details for a Cloud PC, including license availability. The cloudPcFlexConfigurationDetail response indicates whether a Flex license is available, based on the service plan and concurrent-access group for the Cloud PC. This function retrieves license availability, not the power state of the Cloud PC. To retrieve its live access state, use retrieveFlexCloudPcAccessConfiguration. +// returns a CloudPcFlexConfigurationDetailable 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/cloudpc-retrieveflexcloudpcconfigurationdetail?view=graph-rest-beta +func (m *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder) Get(ctx context.Context, requestConfiguration *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexConfigurationDetailable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateCloudPcFlexConfigurationDetailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexConfigurationDetailable), nil +} + +// ToGetRequestInformation get Windows 365 Flex (formerly Windows 365 Frontline) configuration details for a Cloud PC, including license availability. The cloudPcFlexConfigurationDetail response indicates whether a Flex license is available, based on the service plan and concurrent-access group for the Cloud PC. This function retrieves license availability, not the power state of the Cloud PC. To retrieve its live access state, use retrieveFlexCloudPcAccessConfiguration. +// returns a *RequestInformation when successful +func (m *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder when successful +func (m *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder) WithUrl(rawUrl string) *VirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + return NewVirtualEndpointCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/devicemanagement/virtual_endpoint_cloud_p_cs_item_set_device_name_post_request_body.go b/devicemanagement/virtual_endpoint_cloud_p_cs_item_set_device_name_post_request_body.go new file mode 100644 index 00000000000..3da1d9cd1d0 --- /dev/null +++ b/devicemanagement/virtual_endpoint_cloud_p_cs_item_set_device_name_post_request_body.go @@ -0,0 +1,126 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package devicemanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewVirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody instantiates a new VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody and sets the default values. +func NewVirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody() *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody { + m := &VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateVirtualEndpointCloudPCsItemSetDeviceNamePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVirtualEndpointCloudPCsItemSetDeviceNamePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDeviceName gets the deviceName property value. The deviceName property +// returns a *string when successful +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) GetDeviceName() *string { + val, err := m.GetBackingStore().Get("deviceName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["deviceName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeviceName(val) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("deviceName", m.GetDeviceName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDeviceName sets the deviceName property value. The deviceName property +func (m *VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBody) SetDeviceName(value *string) { + err := m.GetBackingStore().Set("deviceName", value) + if err != nil { + panic(err) + } +} + +type VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDeviceName() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDeviceName(value *string) +} diff --git a/devicemanagement/virtual_endpoint_cloud_p_cs_item_set_device_name_request_builder.go b/devicemanagement/virtual_endpoint_cloud_p_cs_item_set_device_name_request_builder.go new file mode 100644 index 00000000000..14b3aabe508 --- /dev/null +++ b/devicemanagement/virtual_endpoint_cloud_p_cs_item_set_device_name_request_builder.go @@ -0,0 +1,80 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package devicemanagement + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder provides operations to call the setDeviceName method. +type VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderInternal instantiates a new VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder and sets the default values. +func NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder { + m := &VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/deviceManagement/virtualEndpoint/cloudPCs/{cloudPC%2Did}/setDeviceName", pathParameters), + } + return m +} + +// NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder instantiates a new VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder and sets the default values. +func NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post set the operating system device name of a Cloud PC. This action runs asynchronously and changes the computer name, not the displayName property. To change the display name, use rename. This action supports Windows 365 Enterprise and Windows 365 Flex (formerly Frontline) Cloud PCs in dedicated mode. Use getSupportedCloudPcRemoteActions to check whether the action is available for a Cloud PC. +// 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/cloudpc-setdevicename?view=graph-rest-beta +func (m *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder) Post(ctx context.Context, body VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBodyable, requestConfiguration *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration) error { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// ToPostRequestInformation set the operating system device name of a Cloud PC. This action runs asynchronously and changes the computer name, not the displayName property. To change the display name, use rename. This action supports Windows 365 Enterprise and Windows 365 Flex (formerly Frontline) Cloud PCs in dedicated mode. Use getSupportedCloudPcRemoteActions to check whether the action is available for a Cloud PC. +// returns a *RequestInformation when successful +func (m *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder) ToPostRequestInformation(ctx context.Context, body VirtualEndpointCloudPCsItemSetDeviceNamePostRequestBodyable, requestConfiguration *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration) (*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. +// returns a *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder when successful +func (m *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder) WithUrl(rawUrl string) *VirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder { + return NewVirtualEndpointCloudPCsItemSetDeviceNameRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/devices/device_item_request_builder.go b/devices/device_item_request_builder.go index a86c3c0c4f0..4c355cb6be5 100644 --- a/devices/device_item_request_builder.go +++ b/devices/device_item_request_builder.go @@ -82,7 +82,7 @@ func NewDeviceItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263 return NewDeviceItemRequestBuilderInternal(urlParams, requestAdapter) } -// Delete delete a registered device. +// Delete delete a registered device. When deleted, the device is moved to the deleted items container and is available for recovery for up to 30 days. After 30 days, the device is permanently deleted.- To learn more, see deletedItems.- For more information about soft deletion behavior for devices, see Device soft delete overview (preview). // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] // @@ -198,7 +198,7 @@ func (m *DeviceItemRequestBuilder) Restore() *ItemRestoreRequestBuilder { return NewItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// ToDeleteRequestInformation delete a registered device. +// ToDeleteRequestInformation delete a registered device. When deleted, the device is moved to the deleted items container and is available for recovery for up to 30 days. After 30 days, the device is permanently deleted.- To learn more, see deletedItems.- For more information about soft deletion behavior for devices, see Device soft delete overview (preview). // returns a *RequestInformation when successful func (m *DeviceItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeviceItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/devices/item_restore_request_builder.go b/devices/item_restore_request_builder.go index a2dae6eccf2..770497dd69f 100644 --- a/devices/item_restore_request_builder.go +++ b/devices/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/deviceswithdeviceid/devices_with_device_id_request_builder.go b/deviceswithdeviceid/devices_with_device_id_request_builder.go index e5365f4e914..97c8ed24638 100644 --- a/deviceswithdeviceid/devices_with_device_id_request_builder.go +++ b/deviceswithdeviceid/devices_with_device_id_request_builder.go @@ -67,7 +67,7 @@ func NewDevicesWithDeviceIdRequestBuilder(rawUrl string, requestAdapter i2ae4187 return NewDevicesWithDeviceIdRequestBuilderInternal(urlParams, requestAdapter, nil) } -// Delete delete a registered device. +// Delete delete a registered device. When deleted, the device is moved to the deleted items container and is available for recovery for up to 30 days. After 30 days, the device is permanently deleted.- To learn more, see deletedItems.- For more information about soft deletion behavior for devices, see Device soft delete overview (preview). // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] // @@ -135,7 +135,7 @@ func (m *DevicesWithDeviceIdRequestBuilder) Patch(ctx context.Context, body ie23 return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Deviceable), nil } -// ToDeleteRequestInformation delete a registered device. +// ToDeleteRequestInformation delete a registered device. When deleted, the device is moved to the deleted items container and is available for recovery for up to 30 days. After 30 days, the device is permanently deleted.- To learn more, see deletedItems.- For more information about soft deletion behavior for devices, see Device soft delete overview (preview). // returns a *RequestInformation when successful func (m *DevicesWithDeviceIdRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DevicesWithDeviceIdRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directory/deleted_items_directory_object_item_request_builder.go b/directory/deleted_items_directory_object_item_request_builder.go index 00519981387..ba8ce7bedc8 100644 --- a/directory/deleted_items_directory_object_item_request_builder.go +++ b/directory/deleted_items_directory_object_item_request_builder.go @@ -23,7 +23,7 @@ type DeletedItemsDirectoryObjectItemRequestBuilderDeleteRequestConfiguration str Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// DeletedItemsDirectoryObjectItemRequestBuilderGetQueryParameters retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// DeletedItemsDirectoryObjectItemRequestBuilderGetQueryParameters retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user type DeletedItemsDirectoryObjectItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -68,7 +68,7 @@ func NewDeletedItemsDirectoryObjectItemRequestBuilder(rawUrl string, requestAdap return NewDeletedItemsDirectoryObjectItemRequestBuilderInternal(urlParams, requestAdapter) } -// Delete permanently delete a recently deleted directory object from deleted items. The following types are supported:- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user After an item is permanently deleted, it cannot be restored. Administrative units cannot be permanently deleted by using the deletedItems API. Soft-deleted administrative units will be permanently deleted 30 days after initial deletion unless they are restored. +// Delete permanently delete a recently deleted directory object from deleted items. The following types are supported:- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user After an item is permanently deleted, it cannot be restored. Administrative units cannot be permanently deleted by using the deletedItems API. Soft-deleted administrative units will be permanently deleted 30 days after initial deletion unless they are restored. // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] // @@ -88,7 +88,7 @@ func (m *DeletedItemsDirectoryObjectItemRequestBuilder) Delete(ctx context.Conte return nil } -// Get retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// Get retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -166,7 +166,7 @@ func (m *DeletedItemsDirectoryObjectItemRequestBuilder) Restore() *DeletedItemsI return NewDeletedItemsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// ToDeleteRequestInformation permanently delete a recently deleted directory object from deleted items. The following types are supported:- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user After an item is permanently deleted, it cannot be restored. Administrative units cannot be permanently deleted by using the deletedItems API. Soft-deleted administrative units will be permanently deleted 30 days after initial deletion unless they are restored. +// ToDeleteRequestInformation permanently delete a recently deleted directory object from deleted items. The following types are supported:- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user After an item is permanently deleted, it cannot be restored. Administrative units cannot be permanently deleted by using the deletedItems API. Soft-deleted administrative units will be permanently deleted 30 days after initial deletion unless they are restored. // returns a *RequestInformation when successful func (m *DeletedItemsDirectoryObjectItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeletedItemsDirectoryObjectItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -178,7 +178,7 @@ func (m *DeletedItemsDirectoryObjectItemRequestBuilder) ToDeleteRequestInformati return requestInfo, nil } -// ToGetRequestInformation retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// ToGetRequestInformation retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a *RequestInformation when successful func (m *DeletedItemsDirectoryObjectItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedItemsDirectoryObjectItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directory/deleted_items_graph_group_request_builder.go b/directory/deleted_items_graph_group_request_builder.go index ac68977d802..acabd4e3668 100644 --- a/directory/deleted_items_graph_group_request_builder.go +++ b/directory/deleted_items_graph_group_request_builder.go @@ -15,7 +15,7 @@ type DeletedItemsGraphGroupRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// DeletedItemsGraphGroupRequestBuilderGetQueryParameters retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// DeletedItemsGraphGroupRequestBuilderGetQueryParameters retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user type DeletedItemsGraphGroupRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -66,7 +66,7 @@ func (m *DeletedItemsGraphGroupRequestBuilder) Count() *DeletedItemsGraphGroupCo return NewDeletedItemsGraphGroupCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// Get retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a GroupCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -90,7 +90,7 @@ func (m *DeletedItemsGraphGroupRequestBuilder) Get(ctx context.Context, requestC return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.GroupCollectionResponseable), nil } -// ToGetRequestInformation retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// ToGetRequestInformation retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a *RequestInformation when successful func (m *DeletedItemsGraphGroupRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedItemsGraphGroupRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directory/deleted_items_item_graph_group_request_builder.go b/directory/deleted_items_item_graph_group_request_builder.go index ac6a3487dc0..ba9772b5a8d 100644 --- a/directory/deleted_items_item_graph_group_request_builder.go +++ b/directory/deleted_items_item_graph_group_request_builder.go @@ -15,7 +15,7 @@ type DeletedItemsItemGraphGroupRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// DeletedItemsItemGraphGroupRequestBuilderGetQueryParameters retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// DeletedItemsItemGraphGroupRequestBuilderGetQueryParameters retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user type DeletedItemsItemGraphGroupRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewDeletedItemsItemGraphGroupRequestBuilder(rawUrl string, requestAdapter i return NewDeletedItemsItemGraphGroupRequestBuilderInternal(urlParams, requestAdapter) } -// Get retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// Get retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a Groupable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -72,7 +72,7 @@ func (m *DeletedItemsItemGraphGroupRequestBuilder) Get(ctx context.Context, requ return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Groupable), nil } -// ToGetRequestInformation retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// ToGetRequestInformation retrieve a list of recently deleted directory objects from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a *RequestInformation when successful func (m *DeletedItemsItemGraphGroupRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedItemsItemGraphGroupRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directory/deleted_items_item_restore_request_builder.go b/directory/deleted_items_item_restore_request_builder.go index afeeadca6da..686cd0162e1 100644 --- a/directory/deleted_items_item_restore_request_builder.go +++ b/directory/deleted_items_item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewDeletedItemsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae return NewDeletedItemsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *DeletedItemsItemRestoreRequestBuilder) Post(ctx context.Context, reques return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *DeletedItemsItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *DeletedItemsItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directory/deleted_items_request_builder.go b/directory/deleted_items_request_builder.go index bff5f03b30f..02cb9e47a71 100644 --- a/directory/deleted_items_request_builder.go +++ b/directory/deleted_items_request_builder.go @@ -15,7 +15,7 @@ type DeletedItemsRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// DeletedItemsRequestBuilderGetQueryParameters retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// DeletedItemsRequestBuilderGetQueryParameters retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user type DeletedItemsRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *DeletedItemsRequestBuilder) Count() *DeletedItemsCountRequestBuilder { return NewDeletedItemsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// Get retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a DirectoryObjectCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *DeletedItemsRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedItemsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectCollectionResponseable, error) { @@ -142,7 +142,7 @@ func (m *DeletedItemsRequestBuilder) GraphUser() *DeletedItemsGraphUserRequestBu return NewDeletedItemsGraphUserRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// ToGetRequestInformation retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user +// ToGetRequestInformation retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user // returns a *RequestInformation when successful func (m *DeletedItemsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedItemsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directoryobjects/item_restore_request_builder.go b/directoryobjects/item_restore_request_builder.go index 05be2ae598d..4f52ca35d15 100644 --- a/directoryobjects/item_restore_request_builder.go +++ b/directoryobjects/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directoryroles/item_restore_request_builder.go b/directoryroles/item_restore_request_builder.go index 4f910d4003f..32e4c5a0944 100644 --- a/directoryroles/item_restore_request_builder.go +++ b/directoryroles/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directoryroletemplates/item_restore_request_builder.go b/directoryroletemplates/item_restore_request_builder.go index 8d29dddc79c..7e52dd1c90d 100644 --- a/directoryroletemplates/item_restore_request_builder.go +++ b/directoryroletemplates/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/directorysettingtemplates/item_restore_request_builder.go b/directorysettingtemplates/item_restore_request_builder.go index 2f8bbb23794..9412f01e3f0 100644 --- a/directorysettingtemplates/item_restore_request_builder.go +++ b/directorysettingtemplates/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_planner_plans_escaped_v2_plan_item_request_builder.go b/groups/item_planner_plans_escaped_v2_plan_item_request_builder.go index 991b8ae5964..a4fcb71630c 100644 --- a/groups/item_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/groups/item_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the group. +// ItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the group. type ItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemPlannerPlans_v2PlanItemRequestBuilder(rawUrl string, requestAdapter return NewItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the group. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the group. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, req return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the group. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the group. // returns a *RequestInformation when successful func (m *ItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_planner_request_builder.go b/groups/item_planner_request_builder.go index 2a8a4c14a7a..caa2c915ae7 100644 --- a/groups/item_planner_request_builder.go +++ b/groups/item_planner_request_builder.go @@ -64,11 +64,8 @@ func NewItemPlannerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemPlannerRequestBuilderInternal(urlParams, requestAdapter) } -// Delete delete a plannerGroup object. +// Delete delete navigation property planner for groups // 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/group-delete-planner?view=graph-rest-beta func (m *ItemPlannerRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPlannerRequestBuilderDeleteRequestConfiguration) error { requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) if err != nil { @@ -108,12 +105,9 @@ func (m *ItemPlannerRequestBuilder) Get(ctx context.Context, requestConfiguratio return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlannerGroupable), nil } -// Patch update the properties of a plannerGroup object. +// Patch update the navigation property planner in groups // returns a PlannerGroupable 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/plannergroup-update?view=graph-rest-beta func (m *ItemPlannerRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlannerGroupable, requestConfiguration *ItemPlannerRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlannerGroupable, error) { requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) if err != nil { @@ -144,7 +138,7 @@ func (m *ItemPlannerRequestBuilder) Plans_v2() *ItemPlannerPlans_v2RequestBuilde return NewItemPlannerPlans_v2RequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// ToDeleteRequestInformation delete a plannerGroup object. +// ToDeleteRequestInformation delete navigation property planner for groups // returns a *RequestInformation when successful func (m *ItemPlannerRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPlannerRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -171,7 +165,7 @@ func (m *ItemPlannerRequestBuilder) ToGetRequestInformation(ctx context.Context, return requestInfo, nil } -// ToPatchRequestInformation update the properties of a plannerGroup object. +// ToPatchRequestInformation update the navigation property planner in groups // returns a *RequestInformation when successful func (m *ItemPlannerRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlannerGroupable, requestConfiguration *ItemPlannerRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_restore_request_builder.go b/groups/item_restore_request_builder.go index cc317acedb3..39044258acf 100644 --- a/groups/item_restore_request_builder.go +++ b/groups/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_team_channels_channel_item_request_builder.go b/groups/item_team_channels_channel_item_request_builder.go index db0760eb28d..1965ef69f7e 100644 --- a/groups/item_team_channels_channel_item_request_builder.go +++ b/groups/item_team_channels_channel_item_request_builder.go @@ -213,6 +213,12 @@ func (m *ItemTeamChannelsChannelItemRequestBuilder) Tabs() *ItemTeamChannelsItem return NewItemTeamChannelsItemTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamChannelsItemTagsRequestBuilder when successful +func (m *ItemTeamChannelsChannelItemRequestBuilder) Tags() *ItemTeamChannelsItemTagsRequestBuilder { + return NewItemTeamChannelsItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property channels for groups // returns a *RequestInformation when successful func (m *ItemTeamChannelsChannelItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsChannelItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/groups/item_team_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go b/groups/item_team_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go index 546886de499..af432619d17 100644 --- a/groups/item_team_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/groups/item_team_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilder(rawUrl string, return NewItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx cont return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_team_channels_item_planner_plans_escaped_v2_request_builder.go b/groups/item_team_channels_item_planner_plans_escaped_v2_request_builder.go index 51f832b25f9..b6f44b031d2 100644 --- a/groups/item_team_channels_item_planner_plans_escaped_v2_request_builder.go +++ b/groups/item_team_channels_item_planner_plans_escaped_v2_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamChannelsItemPlannerPlans_v2RequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *ItemTeamChannelsItemPlannerPlans_v2RequestBuilder) Count() *ItemTeamCha return NewItemTeamChannelsItemPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *ItemTeamChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx context.Cont return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamChannelsItemPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_team_channels_item_tags_count_request_builder.go b/groups/item_team_channels_item_tags_count_request_builder.go new file mode 100644 index 00000000000..40492114a9f --- /dev/null +++ b/groups/item_team_channels_item_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamChannelsItemTagsCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamChannelsItemTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamChannelsItemTagsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamChannelsItemTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamChannelsItemTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamChannelsItemTagsCountRequestBuilderGetQueryParameters +} + +// NewItemTeamChannelsItemTagsCountRequestBuilderInternal instantiates a new ItemTeamChannelsItemTagsCountRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsCountRequestBuilder { + m := &ItemTeamChannelsItemTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/channels/{channel%2Did}/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamChannelsItemTagsCountRequestBuilder instantiates a new ItemTeamChannelsItemTagsCountRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamChannelsItemTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamChannelsItemTagsCountRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamChannelsItemTagsCountRequestBuilder { + return NewItemTeamChannelsItemTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_channels_item_tags_item_members_count_request_builder.go b/groups/item_team_channels_item_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..c952c97844e --- /dev/null +++ b/groups/item_team_channels_item_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamChannelsItemTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamChannelsItemTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewItemTeamChannelsItemTagsItemMembersCountRequestBuilderInternal instantiates a new ItemTeamChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder { + m := &ItemTeamChannelsItemTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamChannelsItemTagsItemMembersCountRequestBuilder instantiates a new ItemTeamChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamChannelsItemTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder { + return NewItemTeamChannelsItemTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_channels_item_tags_item_members_request_builder.go b/groups/item_team_channels_item_tags_item_members_request_builder.go new file mode 100644 index 00000000000..b971d38d050 --- /dev/null +++ b/groups/item_team_channels_item_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamChannelsItemTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamChannelsItemTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamChannelsItemTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamChannelsItemTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamChannelsItemTagsItemMembersRequestBuilderGetQueryParameters +} + +// ItemTeamChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamChannelsItemTagsItemMembersRequestBuilderInternal instantiates a new ItemTeamChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsItemMembersRequestBuilder { + m := &ItemTeamChannelsItemTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamChannelsItemTagsItemMembersRequestBuilder instantiates a new ItemTeamChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamChannelsItemTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) Count() *ItemTeamChannelsItemTagsItemMembersCountRequestBuilder { + return NewItemTeamChannelsItemTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for groups +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for groups +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamChannelsItemTagsItemMembersRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *ItemTeamChannelsItemTagsItemMembersRequestBuilder { + return NewItemTeamChannelsItemTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go b/groups/item_team_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..8204f35d1ee --- /dev/null +++ b/groups/item_team_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for groups +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in groups +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for groups +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in groups +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewItemTeamChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_channels_item_tags_request_builder.go b/groups/item_team_channels_item_tags_request_builder.go new file mode 100644 index 00000000000..155367495fe --- /dev/null +++ b/groups/item_team_channels_item_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamChannelsItemTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamChannelsItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamChannelsItemTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamChannelsItemTagsRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamChannelsItemTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamChannelsItemTagsRequestBuilderGetQueryParameters +} + +// ItemTeamChannelsItemTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamChannelsItemTagsRequestBuilderInternal instantiates a new ItemTeamChannelsItemTagsRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsRequestBuilder { + m := &ItemTeamChannelsItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/channels/{channel%2Did}/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamChannelsItemTagsRequestBuilder instantiates a new ItemTeamChannelsItemTagsRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamChannelsItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamChannelsItemTagsCountRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsRequestBuilder) Count() *ItemTeamChannelsItemTagsCountRequestBuilder { + return NewItemTeamChannelsItemTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for groups +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamChannelsItemTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for groups +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamChannelsItemTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamChannelsItemTagsRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsRequestBuilder) WithUrl(rawUrl string) *ItemTeamChannelsItemTagsRequestBuilder { + return NewItemTeamChannelsItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_channels_item_tags_teamwork_channel_tag_item_request_builder.go b/groups/item_team_channels_item_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..dc053437bcd --- /dev/null +++ b/groups/item_team_channels_item_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + m := &ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder instantiates a new ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for groups +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamChannelsItemTagsItemMembersRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Members() *ItemTeamChannelsItemTagsItemMembersRequestBuilder { + return NewItemTeamChannelsItemTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in groups +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for groups +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in groups +// returns a *RequestInformation when successful +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + return NewItemTeamChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go b/groups/item_team_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go index cf3a4577d2e..49a48873e29 100644 --- a/groups/item_team_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/groups/item_team_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder(rawUrl strin return NewItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) Get(ctx co return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_team_primary_channel_planner_plans_escaped_v2_request_builder.go b/groups/item_team_primary_channel_planner_plans_escaped_v2_request_builder.go index 68e7113de4a..bf6163b807d 100644 --- a/groups/item_team_primary_channel_planner_plans_escaped_v2_request_builder.go +++ b/groups/item_team_primary_channel_planner_plans_escaped_v2_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilder) Count() *ItemTeamP return NewItemTeamPrimaryChannelPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx context.Co return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/groups/item_team_primary_channel_request_builder.go b/groups/item_team_primary_channel_request_builder.go index 7848515a22f..fd261e767f0 100644 --- a/groups/item_team_primary_channel_request_builder.go +++ b/groups/item_team_primary_channel_request_builder.go @@ -213,6 +213,12 @@ func (m *ItemTeamPrimaryChannelRequestBuilder) Tabs() *ItemTeamPrimaryChannelTab return NewItemTeamPrimaryChannelTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamPrimaryChannelTagsRequestBuilder when successful +func (m *ItemTeamPrimaryChannelRequestBuilder) Tags() *ItemTeamPrimaryChannelTagsRequestBuilder { + return NewItemTeamPrimaryChannelTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property primaryChannel for groups // returns a *RequestInformation when successful func (m *ItemTeamPrimaryChannelRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/groups/item_team_primary_channel_tags_count_request_builder.go b/groups/item_team_primary_channel_tags_count_request_builder.go new file mode 100644 index 00000000000..bff92c6e5dc --- /dev/null +++ b/groups/item_team_primary_channel_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamPrimaryChannelTagsCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamPrimaryChannelTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamPrimaryChannelTagsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamPrimaryChannelTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamPrimaryChannelTagsCountRequestBuilderGetQueryParameters +} + +// NewItemTeamPrimaryChannelTagsCountRequestBuilderInternal instantiates a new ItemTeamPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsCountRequestBuilder { + m := &ItemTeamPrimaryChannelTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/primaryChannel/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamPrimaryChannelTagsCountRequestBuilder instantiates a new ItemTeamPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamPrimaryChannelTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamPrimaryChannelTagsCountRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamPrimaryChannelTagsCountRequestBuilder { + return NewItemTeamPrimaryChannelTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_primary_channel_tags_item_members_count_request_builder.go b/groups/item_team_primary_channel_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..7b067cd90c7 --- /dev/null +++ b/groups/item_team_primary_channel_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderInternal instantiates a new ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder { + m := &ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/primaryChannel/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder instantiates a new ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_primary_channel_tags_item_members_request_builder.go b/groups/item_team_primary_channel_tags_item_members_request_builder.go new file mode 100644 index 00000000000..d0a68f87282 --- /dev/null +++ b/groups/item_team_primary_channel_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamPrimaryChannelTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamPrimaryChannelTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters +} + +// ItemTeamPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamPrimaryChannelTagsItemMembersRequestBuilderInternal instantiates a new ItemTeamPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder { + m := &ItemTeamPrimaryChannelTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/primaryChannel/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamPrimaryChannelTagsItemMembersRequestBuilder instantiates a new ItemTeamPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamPrimaryChannelTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) Count() *ItemTeamPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewItemTeamPrimaryChannelTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for groups +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for groups +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder { + return NewItemTeamPrimaryChannelTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go b/groups/item_team_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..3defe82bacd --- /dev/null +++ b/groups/item_team_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/primaryChannel/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for groups +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in groups +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for groups +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in groups +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewItemTeamPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_primary_channel_tags_request_builder.go b/groups/item_team_primary_channel_tags_request_builder.go new file mode 100644 index 00000000000..1eac7209c55 --- /dev/null +++ b/groups/item_team_primary_channel_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamPrimaryChannelTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamPrimaryChannelTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamPrimaryChannelTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamPrimaryChannelTagsRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamPrimaryChannelTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamPrimaryChannelTagsRequestBuilderGetQueryParameters +} + +// ItemTeamPrimaryChannelTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamPrimaryChannelTagsRequestBuilderInternal instantiates a new ItemTeamPrimaryChannelTagsRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsRequestBuilder { + m := &ItemTeamPrimaryChannelTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/primaryChannel/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamPrimaryChannelTagsRequestBuilder instantiates a new ItemTeamPrimaryChannelTagsRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamPrimaryChannelTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamPrimaryChannelTagsCountRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) Count() *ItemTeamPrimaryChannelTagsCountRequestBuilder { + return NewItemTeamPrimaryChannelTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for groups +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for groups +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamPrimaryChannelTagsRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsRequestBuilder) WithUrl(rawUrl string) *ItemTeamPrimaryChannelTagsRequestBuilder { + return NewItemTeamPrimaryChannelTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/groups/item_team_primary_channel_tags_teamwork_channel_tag_item_request_builder.go b/groups/item_team_primary_channel_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..6ce765f8fb6 --- /dev/null +++ b/groups/item_team_primary_channel_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package groups + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + m := &ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/groups/{group%2Did}/team/primaryChannel/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder instantiates a new ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for groups +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Members() *ItemTeamPrimaryChannelTagsItemMembersRequestBuilder { + return NewItemTeamPrimaryChannelTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in groups +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for groups +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in groups +// returns a *RequestInformation when successful +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + return NewItemTeamPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/identity/conditional_access_request_builder.go b/identity/conditional_access_request_builder.go index 5986849faa2..ea775aa45f3 100644 --- a/identity/conditional_access_request_builder.go +++ b/identity/conditional_access_request_builder.go @@ -69,6 +69,12 @@ func (m *ConditionalAccessRequestBuilder) Policies() *ConditionalAccessPoliciesR return NewConditionalAccessPoliciesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Settings provides operations to manage the settings property of the microsoft.graph.conditionalAccessRoot entity. +// returns a *ConditionalAccessSettingsRequestBuilder when successful +func (m *ConditionalAccessRequestBuilder) Settings() *ConditionalAccessSettingsRequestBuilder { + return NewConditionalAccessSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // Templates provides operations to manage the templates property of the microsoft.graph.conditionalAccessRoot entity. // returns a *ConditionalAccessTemplatesRequestBuilder when successful func (m *ConditionalAccessRequestBuilder) Templates() *ConditionalAccessTemplatesRequestBuilder { diff --git a/identity/conditional_access_settings_request_builder.go b/identity/conditional_access_settings_request_builder.go new file mode 100644 index 00000000000..5aab641aa9c --- /dev/null +++ b/identity/conditional_access_settings_request_builder.go @@ -0,0 +1,182 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package identity + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ConditionalAccessSettingsRequestBuilder provides operations to manage the settings property of the microsoft.graph.conditionalAccessRoot entity. +type ConditionalAccessSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ConditionalAccessSettingsRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ConditionalAccessSettingsRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ConditionalAccessSettingsRequestBuilderGetQueryParameters get the tenant's Conditional Access settings. +type ConditionalAccessSettingsRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ConditionalAccessSettingsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ConditionalAccessSettingsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ConditionalAccessSettingsRequestBuilderGetQueryParameters +} + +// ConditionalAccessSettingsRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ConditionalAccessSettingsRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewConditionalAccessSettingsRequestBuilderInternal instantiates a new ConditionalAccessSettingsRequestBuilder and sets the default values. +func NewConditionalAccessSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ConditionalAccessSettingsRequestBuilder { + m := &ConditionalAccessSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/identity/conditionalAccess/settings{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewConditionalAccessSettingsRequestBuilder instantiates a new ConditionalAccessSettingsRequestBuilder and sets the default values. +func NewConditionalAccessSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ConditionalAccessSettingsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewConditionalAccessSettingsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete reset Conditional Access settings to their defaults. This operation clears user-action exclusions without deleting the settings singleton. +// 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/conditionalaccessroot-delete-settings?view=graph-rest-beta +func (m *ConditionalAccessSettingsRequestBuilder) Delete(ctx context.Context, requestConfiguration *ConditionalAccessSettingsRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get the tenant's Conditional Access settings. +// returns a ConditionalAccessSettingsable 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/conditionalaccesssettings-get?view=graph-rest-beta +func (m *ConditionalAccessSettingsRequestBuilder) Get(ctx context.Context, requestConfiguration *ConditionalAccessSettingsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConditionalAccessSettingsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateConditionalAccessSettingsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConditionalAccessSettingsable), nil +} + +// Patch update the tenant's Conditional Access settings. +// returns a ConditionalAccessSettingsable 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/conditionalaccesssettings-update?view=graph-rest-beta +func (m *ConditionalAccessSettingsRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConditionalAccessSettingsable, requestConfiguration *ConditionalAccessSettingsRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConditionalAccessSettingsable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateConditionalAccessSettingsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConditionalAccessSettingsable), nil +} + +// ToDeleteRequestInformation reset Conditional Access settings to their defaults. This operation clears user-action exclusions without deleting the settings singleton. +// returns a *RequestInformation when successful +func (m *ConditionalAccessSettingsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ConditionalAccessSettingsRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get the tenant's Conditional Access settings. +// returns a *RequestInformation when successful +func (m *ConditionalAccessSettingsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ConditionalAccessSettingsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the tenant's Conditional Access settings. +// returns a *RequestInformation when successful +func (m *ConditionalAccessSettingsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ConditionalAccessSettingsable, requestConfiguration *ConditionalAccessSettingsRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ConditionalAccessSettingsRequestBuilder when successful +func (m *ConditionalAccessSettingsRequestBuilder) WithUrl(rawUrl string) *ConditionalAccessSettingsRequestBuilder { + return NewConditionalAccessSettingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/kiota-dom-export.txt b/kiota-dom-export.txt index 49d7008d7c3..a6990c3173b 100644 --- a/kiota-dom-export.txt +++ b/kiota-dom-export.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:095b1f8466e014503a6adb5cb39b15fd5d40a722f7ca6958473d4019a1d8f8dd -size 115828586 +oid sha256:a3e5d701f0d747fcc92dfcd5cd00f77eccd1e00aae9bfe32a77ad0da8439c630 +size 116972612 diff --git a/kiota-lock.json b/kiota-lock.json index 761978ec1f0..a129383618a 100644 --- a/kiota-lock.json +++ b/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "F22B306D14576A96CBB88568ABF4AA47B326FF270B7F172C22C87DB735E99E49DC25763C1B275CE9547D8DFAA8EF0129536DC4211134B89C89740DE860CF23D2", + "descriptionHash": "7C71F494EC56C0C03F694684EBE9E1A74B894DFB2931710B66500F0513496967C274B808FFBC38D9B1B124CF0241A1AF9197E1A4FBD76DDA197363AB5F0EA27E", "descriptionLocation": "../../msgraph-metadata/clean_beta_openapi/openapi.yaml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.38.0", diff --git a/models/admin.go b/models/admin.go index 23f43cb5235..7c845e7d94e 100644 --- a/models/admin.go +++ b/models/admin.go @@ -239,6 +239,16 @@ func (m *Admin) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388 } return nil } + res["resourcePolicy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateResourcePolicyRootFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResourcePolicy(val.(ResourcePolicyRootable)) + } + return nil + } res["serviceAnnouncement"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateServiceAnnouncementFromDiscriminatorValue) if err != nil { @@ -347,6 +357,19 @@ func (m *Admin) GetReportSettings() AdminReportSettingsable { return nil } +// GetResourcePolicy gets the resourcePolicy property value. The resourcePolicy property +// returns a ResourcePolicyRootable when successful +func (m *Admin) GetResourcePolicy() ResourcePolicyRootable { + val, err := m.GetBackingStore().Get("resourcePolicy") + if err != nil { + panic(err) + } + if val != nil { + return val.(ResourcePolicyRootable) + } + return nil +} + // GetServiceAnnouncement gets the serviceAnnouncement property value. A container for service communications resources. Read-only. // returns a ServiceAnnouncementable when successful func (m *Admin) GetServiceAnnouncement() ServiceAnnouncementable { @@ -467,6 +490,12 @@ func (m *Admin) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4 return err } } + { + err := writer.WriteObjectValue("resourcePolicy", m.GetResourcePolicy()) + if err != nil { + return err + } + } { err := writer.WriteObjectValue("serviceAnnouncement", m.GetServiceAnnouncement()) if err != nil { @@ -601,6 +630,14 @@ func (m *Admin) SetReportSettings(value AdminReportSettingsable) { } } +// SetResourcePolicy sets the resourcePolicy property value. The resourcePolicy property +func (m *Admin) SetResourcePolicy(value ResourcePolicyRootable) { + err := m.GetBackingStore().Set("resourcePolicy", value) + if err != nil { + panic(err) + } +} + // SetServiceAnnouncement sets the serviceAnnouncement property value. A container for service communications resources. Read-only. func (m *Admin) SetServiceAnnouncement(value ServiceAnnouncementable) { err := m.GetBackingStore().Set("serviceAnnouncement", value) @@ -649,6 +686,7 @@ type Adminable interface { GetOdataType() *string GetPeople() PeopleAdminSettingsable GetReportSettings() AdminReportSettingsable + GetResourcePolicy() ResourcePolicyRootable GetServiceAnnouncement() ServiceAnnouncementable GetSharepoint() Sharepointable GetTodo() AdminTodoable @@ -665,6 +703,7 @@ type Adminable interface { SetOdataType(value *string) SetPeople(value PeopleAdminSettingsable) SetReportSettings(value AdminReportSettingsable) + SetResourcePolicy(value ResourcePolicyRootable) SetServiceAnnouncement(value ServiceAnnouncementable) SetSharepoint(value Sharepointable) SetTodo(value AdminTodoable) diff --git a/models/agent_info.go b/models/agent_info.go new file mode 100644 index 00000000000..6d028657f20 --- /dev/null +++ b/models/agent_info.go @@ -0,0 +1,259 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// AgentInfo embedded description of the agent that performed a run, without an independently addressable catalog. +type AgentInfo struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewAgentInfo instantiates a new AgentInfo and sets the default values. +func NewAgentInfo() *AgentInfo { + m := &AgentInfo{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateAgentInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAgentInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAgentInfo(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *AgentInfo) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetApplicationId gets the applicationId property value. The agent's Microsoft Entra application identifier, when available. +// returns a *string when successful +func (m *AgentInfo) GetApplicationId() *string { + val, err := m.GetBackingStore().Get("applicationId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *AgentInfo) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDefinitionName gets the definitionName property value. The qualified agent definition name, when available. Not an addressable catalog link. +// returns a *string when successful +func (m *AgentInfo) GetDefinitionName() *string { + val, err := m.GetBackingStore().Get("definitionName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayName gets the displayName property value. The agent's display name, when available. +// returns a *string when successful +func (m *AgentInfo) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AgentInfo) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["applicationId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetApplicationId(val) + } + return nil + } + res["definitionName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefinitionName(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["key"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetKey gets the key property value. The opaque identifier of the recorded agent instance. A structural property, not an OData entity key. +// returns a *string when successful +func (m *AgentInfo) GetKey() *string { + val, err := m.GetBackingStore().Get("key") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *AgentInfo) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *AgentInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *AgentInfo) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetApplicationId sets the applicationId property value. The agent's Microsoft Entra application identifier, when available. +func (m *AgentInfo) SetApplicationId(value *string) { + err := m.GetBackingStore().Set("applicationId", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *AgentInfo) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDefinitionName sets the definitionName property value. The qualified agent definition name, when available. Not an addressable catalog link. +func (m *AgentInfo) SetDefinitionName(value *string) { + err := m.GetBackingStore().Set("definitionName", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. The agent's display name, when available. +func (m *AgentInfo) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetKey sets the key property value. The opaque identifier of the recorded agent instance. A structural property, not an OData entity key. +func (m *AgentInfo) SetKey(value *string) { + err := m.GetBackingStore().Set("key", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *AgentInfo) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type AgentInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApplicationId() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDefinitionName() *string + GetDisplayName() *string + GetKey() *string + GetOdataType() *string + SetApplicationId(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDefinitionName(value *string) + SetDisplayName(value *string) + SetKey(value *string) + SetOdataType(value *string) +} diff --git a/models/agent_run.go b/models/agent_run.go new file mode 100644 index 00000000000..b3e5f70fdec --- /dev/null +++ b/models/agent_run.go @@ -0,0 +1,443 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// AgentRun an agent's contribution to a session. Read this resource to observe the agent's processing status. +type AgentRun struct { + Entity +} + +// NewAgentRun instantiates a new AgentRun and sets the default values. +func NewAgentRun() *AgentRun { + m := &AgentRun{ + Entity: *NewEntity(), + } + return m +} + +// CreateAgentRunFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAgentRunFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAgentRun(), nil +} + +// GetAgent gets the agent property value. Embedded description of the agent that performed a run, without an independently addressable catalog. +// returns a AgentInfoable when successful +func (m *AgentRun) GetAgent() AgentInfoable { + val, err := m.GetBackingStore().Get("agent") + if err != nil { + panic(err) + } + if val != nil { + return val.(AgentInfoable) + } + return nil +} + +// GetCompletedDateTime gets the completedDateTime property value. The UTC date and time when the run completed successfully, in ISO 8601 format. Absent otherwise. Read-only. +// returns a *Time when successful +func (m *AgentRun) GetCompletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("completedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetCreatedDateTime gets the createdDateTime property value. The UTC date and time when the resource was created, in ISO 8601 format. Read-only. +// returns a *Time when successful +func (m *AgentRun) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDurationInMilliseconds gets the durationInMilliseconds property value. The elapsed time from creation to successful completion, in milliseconds. Absent otherwise. Read-only. +// returns a *int64 when successful +func (m *AgentRun) GetDurationInMilliseconds() *int64 { + val, err := m.GetBackingStore().Get("durationInMilliseconds") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int64) + } + return nil +} + +// GetFailureInfo gets the failureInfo property value. The run-level failure details, when available. Read-only. +// returns a AgentRunFailureInfoable when successful +func (m *AgentRun) GetFailureInfo() AgentRunFailureInfoable { + val, err := m.GetBackingStore().Get("failureInfo") + if err != nil { + panic(err) + } + if val != nil { + return val.(AgentRunFailureInfoable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AgentRun) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["agent"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAgentInfoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAgent(val.(AgentInfoable)) + } + return nil + } + res["completedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedDateTime(val) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["durationInMilliseconds"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetDurationInMilliseconds(val) + } + return nil + } + res["failureInfo"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAgentRunFailureInfoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFailureInfo(val.(AgentRunFailureInfoable)) + } + return nil + } + res["initiatedBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateInvestigationIdentitySetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInitiatedBy(val.(InvestigationIdentitySetable)) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["messages"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationMessageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationMessageable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationMessageable) + } + } + m.SetMessages(res) + } + return nil + } + res["startedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetStartedDateTime(val) + } + return nil + } + res["status"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseLongRunningOperationStatus) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*LongRunningOperationStatus)) + } + return nil + } + res["statusDetail"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusDetail(val) + } + return nil + } + return res +} + +// GetInitiatedBy gets the initiatedBy property value. The initiating principals recorded by the service, when available. Read-only. This property doesn't select an execution identity. +// returns a InvestigationIdentitySetable when successful +func (m *AgentRun) GetInitiatedBy() InvestigationIdentitySetable { + val, err := m.GetBackingStore().Get("initiatedBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(InvestigationIdentitySetable) + } + return nil +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The UTC date and time when the resource was last updated, in ISO 8601 format. Read-only. +// returns a *Time when successful +func (m *AgentRun) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetMessages gets the messages property value. Read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +// returns a []InvestigationMessageable when successful +func (m *AgentRun) GetMessages() []InvestigationMessageable { + val, err := m.GetBackingStore().Get("messages") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationMessageable) + } + return nil +} + +// GetStartedDateTime gets the startedDateTime property value. The UTC start timestamp, in ISO 8601 format. Currently reflects creation time, not a distinct execution-start measurement. Read-only. +// returns a *Time when successful +func (m *AgentRun) GetStartedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("startedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetStatus gets the status property value. The status property +// returns a *LongRunningOperationStatus when successful +func (m *AgentRun) GetStatus() *LongRunningOperationStatus { + val, err := m.GetBackingStore().Get("status") + if err != nil { + panic(err) + } + if val != nil { + return val.(*LongRunningOperationStatus) + } + return nil +} + +// GetStatusDetail gets the statusDetail property value. Additional processing detail, including pendingInput or canceled, when the status alone doesn't describe the source lifecycle. Read-only. Doesn't support $filter. +// returns a *string when successful +func (m *AgentRun) GetStatusDetail() *string { + val, err := m.GetBackingStore().Get("statusDetail") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *AgentRun) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("agent", m.GetAgent()) + if err != nil { + return err + } + } + if m.GetMessages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMessages())) + for i, v := range m.GetMessages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("messages", cast) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err = writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetAgent sets the agent property value. Embedded description of the agent that performed a run, without an independently addressable catalog. +func (m *AgentRun) SetAgent(value AgentInfoable) { + err := m.GetBackingStore().Set("agent", value) + if err != nil { + panic(err) + } +} + +// SetCompletedDateTime sets the completedDateTime property value. The UTC date and time when the run completed successfully, in ISO 8601 format. Absent otherwise. Read-only. +func (m *AgentRun) SetCompletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("completedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetCreatedDateTime sets the createdDateTime property value. The UTC date and time when the resource was created, in ISO 8601 format. Read-only. +func (m *AgentRun) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDurationInMilliseconds sets the durationInMilliseconds property value. The elapsed time from creation to successful completion, in milliseconds. Absent otherwise. Read-only. +func (m *AgentRun) SetDurationInMilliseconds(value *int64) { + err := m.GetBackingStore().Set("durationInMilliseconds", value) + if err != nil { + panic(err) + } +} + +// SetFailureInfo sets the failureInfo property value. The run-level failure details, when available. Read-only. +func (m *AgentRun) SetFailureInfo(value AgentRunFailureInfoable) { + err := m.GetBackingStore().Set("failureInfo", value) + if err != nil { + panic(err) + } +} + +// SetInitiatedBy sets the initiatedBy property value. The initiating principals recorded by the service, when available. Read-only. This property doesn't select an execution identity. +func (m *AgentRun) SetInitiatedBy(value InvestigationIdentitySetable) { + err := m.GetBackingStore().Set("initiatedBy", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The UTC date and time when the resource was last updated, in ISO 8601 format. Read-only. +func (m *AgentRun) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetMessages sets the messages property value. Read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +func (m *AgentRun) SetMessages(value []InvestigationMessageable) { + err := m.GetBackingStore().Set("messages", value) + if err != nil { + panic(err) + } +} + +// SetStartedDateTime sets the startedDateTime property value. The UTC start timestamp, in ISO 8601 format. Currently reflects creation time, not a distinct execution-start measurement. Read-only. +func (m *AgentRun) SetStartedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("startedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetStatus sets the status property value. The status property +func (m *AgentRun) SetStatus(value *LongRunningOperationStatus) { + err := m.GetBackingStore().Set("status", value) + if err != nil { + panic(err) + } +} + +// SetStatusDetail sets the statusDetail property value. Additional processing detail, including pendingInput or canceled, when the status alone doesn't describe the source lifecycle. Read-only. Doesn't support $filter. +func (m *AgentRun) SetStatusDetail(value *string) { + err := m.GetBackingStore().Set("statusDetail", value) + if err != nil { + panic(err) + } +} + +type AgentRunable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAgent() AgentInfoable + GetCompletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDurationInMilliseconds() *int64 + GetFailureInfo() AgentRunFailureInfoable + GetInitiatedBy() InvestigationIdentitySetable + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetMessages() []InvestigationMessageable + GetStartedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetStatus() *LongRunningOperationStatus + GetStatusDetail() *string + SetAgent(value AgentInfoable) + SetCompletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDurationInMilliseconds(value *int64) + SetFailureInfo(value AgentRunFailureInfoable) + SetInitiatedBy(value InvestigationIdentitySetable) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetMessages(value []InvestigationMessageable) + SetStartedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetStatus(value *LongRunningOperationStatus) + SetStatusDetail(value *string) +} diff --git a/models/agent_run_collection_response.go b/models/agent_run_collection_response.go new file mode 100644 index 00000000000..386345ae462 --- /dev/null +++ b/models/agent_run_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AgentRunCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewAgentRunCollectionResponse instantiates a new AgentRunCollectionResponse and sets the default values. +func NewAgentRunCollectionResponse() *AgentRunCollectionResponse { + m := &AgentRunCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateAgentRunCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAgentRunCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAgentRunCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AgentRunCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAgentRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AgentRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AgentRunable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []AgentRunable when successful +func (m *AgentRunCollectionResponse) GetValue() []AgentRunable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]AgentRunable) + } + return nil +} + +// Serialize serializes information the current object +func (m *AgentRunCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *AgentRunCollectionResponse) SetValue(value []AgentRunable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type AgentRunCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []AgentRunable + SetValue(value []AgentRunable) +} diff --git a/models/agent_run_failure_info.go b/models/agent_run_failure_info.go new file mode 100644 index 00000000000..e092f097f35 --- /dev/null +++ b/models/agent_run_failure_info.go @@ -0,0 +1,193 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// AgentRunFailureInfo failure details available from the run status. Not an operation-status resource or an HTTP error. +type AgentRunFailureInfo struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewAgentRunFailureInfo instantiates a new AgentRunFailureInfo and sets the default values. +func NewAgentRunFailureInfo() *AgentRunFailureInfo { + m := &AgentRunFailureInfo{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateAgentRunFailureInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAgentRunFailureInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAgentRunFailureInfo(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *AgentRunFailureInfo) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *AgentRunFailureInfo) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetErrorType gets the errorType property value. The error classification, when available. +// returns a *string when successful +func (m *AgentRunFailureInfo) GetErrorType() *string { + val, err := m.GetBackingStore().Get("errorType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AgentRunFailureInfo) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["errorType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetErrorType(val) + } + return nil + } + res["message"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetMessage gets the message property value. The human-readable failure detail, when available. +// returns a *string when successful +func (m *AgentRunFailureInfo) GetMessage() *string { + val, err := m.GetBackingStore().Get("message") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *AgentRunFailureInfo) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *AgentRunFailureInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *AgentRunFailureInfo) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *AgentRunFailureInfo) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetErrorType sets the errorType property value. The error classification, when available. +func (m *AgentRunFailureInfo) SetErrorType(value *string) { + err := m.GetBackingStore().Set("errorType", value) + if err != nil { + panic(err) + } +} + +// SetMessage sets the message property value. The human-readable failure detail, when available. +func (m *AgentRunFailureInfo) SetMessage(value *string) { + err := m.GetBackingStore().Set("message", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *AgentRunFailureInfo) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type AgentRunFailureInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetErrorType() *string + GetMessage() *string + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetErrorType(value *string) + SetMessage(value *string) + SetOdataType(value *string) +} diff --git a/models/agentic_security_root.go b/models/agentic_security_root.go new file mode 100644 index 00000000000..5599c39358c --- /dev/null +++ b/models/agentic_security_root.go @@ -0,0 +1,150 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AgenticSecurityRoot container for agentic security playbook definitions and sessions. +type AgenticSecurityRoot struct { + Entity +} + +// NewAgenticSecurityRoot instantiates a new AgenticSecurityRoot and sets the default values. +func NewAgenticSecurityRoot() *AgenticSecurityRoot { + m := &AgenticSecurityRoot{ + Entity: *NewEntity(), + } + return m +} + +// CreateAgenticSecurityRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAgenticSecurityRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAgenticSecurityRoot(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AgenticSecurityRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["playbookDefinitions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePlaybookDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PlaybookDefinitionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PlaybookDefinitionable) + } + } + m.SetPlaybookDefinitions(res) + } + return nil + } + res["sessions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationSessionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationSessionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationSessionable) + } + } + m.SetSessions(res) + } + return nil + } + return res +} + +// GetPlaybookDefinitions gets the playbookDefinitions property value. The read-only playbook catalog. Supports list and keyed GET with $select. Doesn't support $filter, $orderby, $search, $expand, $count, $top, $skip, or delta tracking. +// returns a []PlaybookDefinitionable when successful +func (m *AgenticSecurityRoot) GetPlaybookDefinitions() []PlaybookDefinitionable { + val, err := m.GetBackingStore().Get("playbookDefinitions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]PlaybookDefinitionable) + } + return nil +} + +// GetSessions gets the sessions property value. The agentic sessions visible to the caller. Supports list with $filter on status (eq, or, in), $top, and $select; session creation; and keyed reads. Doesn't support $count, $orderby, $search, $expand, $skip, or delta tracking. +// returns a []InvestigationSessionable when successful +func (m *AgenticSecurityRoot) GetSessions() []InvestigationSessionable { + val, err := m.GetBackingStore().Get("sessions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationSessionable) + } + return nil +} + +// Serialize serializes information the current object +func (m *AgenticSecurityRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetPlaybookDefinitions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPlaybookDefinitions())) + for i, v := range m.GetPlaybookDefinitions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("playbookDefinitions", cast) + if err != nil { + return err + } + } + if m.GetSessions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSessions())) + for i, v := range m.GetSessions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("sessions", cast) + if err != nil { + return err + } + } + return nil +} + +// SetPlaybookDefinitions sets the playbookDefinitions property value. The read-only playbook catalog. Supports list and keyed GET with $select. Doesn't support $filter, $orderby, $search, $expand, $count, $top, $skip, or delta tracking. +func (m *AgenticSecurityRoot) SetPlaybookDefinitions(value []PlaybookDefinitionable) { + err := m.GetBackingStore().Set("playbookDefinitions", value) + if err != nil { + panic(err) + } +} + +// SetSessions sets the sessions property value. The agentic sessions visible to the caller. Supports list with $filter on status (eq, or, in), $top, and $select; session creation; and keyed reads. Doesn't support $count, $orderby, $search, $expand, $skip, or delta tracking. +func (m *AgenticSecurityRoot) SetSessions(value []InvestigationSessionable) { + err := m.GetBackingStore().Set("sessions", value) + if err != nil { + panic(err) + } +} + +type AgenticSecurityRootable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPlaybookDefinitions() []PlaybookDefinitionable + GetSessions() []InvestigationSessionable + SetPlaybookDefinitions(value []PlaybookDefinitionable) + SetSessions(value []InvestigationSessionable) +} diff --git a/models/all_resources_exclusions.go b/models/all_resources_exclusions.go new file mode 100644 index 00000000000..1adbb745e06 --- /dev/null +++ b/models/all_resources_exclusions.go @@ -0,0 +1,177 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type AllResourcesExclusions struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewAllResourcesExclusions instantiates a new AllResourcesExclusions and sets the default values. +func NewAllResourcesExclusions() *AllResourcesExclusions { + m := &AllResourcesExclusions{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateAllResourcesExclusionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAllResourcesExclusionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAllResourcesExclusions(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *AllResourcesExclusions) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *AllResourcesExclusions) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AllResourcesExclusions) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["userActionExclusions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUserActionExclusionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]UserActionExclusionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(UserActionExclusionable) + } + } + m.SetUserActionExclusions(res) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *AllResourcesExclusions) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUserActionExclusions gets the userActionExclusions property value. The user-action exclusions and their states. Supply the complete desired collection when updating it. Not nullable. +// returns a []UserActionExclusionable when successful +func (m *AllResourcesExclusions) GetUserActionExclusions() []UserActionExclusionable { + val, err := m.GetBackingStore().Get("userActionExclusions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]UserActionExclusionable) + } + return nil +} + +// Serialize serializes information the current object +func (m *AllResourcesExclusions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetUserActionExclusions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUserActionExclusions())) + for i, v := range m.GetUserActionExclusions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("userActionExclusions", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *AllResourcesExclusions) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *AllResourcesExclusions) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *AllResourcesExclusions) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetUserActionExclusions sets the userActionExclusions property value. The user-action exclusions and their states. Supply the complete desired collection when updating it. Not nullable. +func (m *AllResourcesExclusions) SetUserActionExclusions(value []UserActionExclusionable) { + err := m.GetBackingStore().Set("userActionExclusions", value) + if err != nil { + panic(err) + } +} + +type AllResourcesExclusionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetUserActionExclusions() []UserActionExclusionable + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetUserActionExclusions(value []UserActionExclusionable) +} diff --git a/models/application.go b/models/application.go index 66296d888e0..0da27616073 100644 --- a/models/application.go +++ b/models/application.go @@ -469,6 +469,16 @@ func (m *Application) GetFieldDeserializers() map[string]func(i878a80d2330e89d26 } return nil } + res["identifierUriConfiguration"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApplicationIdentifierUriConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIdentifierUriConfiguration(val.(ApplicationIdentifierUriConfigurationable)) + } + return nil + } res["identifierUris"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfPrimitiveValues("string") if err != nil { @@ -485,6 +495,16 @@ func (m *Application) GetFieldDeserializers() map[string]func(i878a80d2330e89d26 } return nil } + res["idJag"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdJagApplicationConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIdJag(val.(IdJagApplicationConfigurationable)) + } + return nil + } res["info"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateInformationalUrlFromDiscriminatorValue) if err != nil { @@ -525,6 +545,16 @@ func (m *Application) GetFieldDeserializers() map[string]func(i878a80d2330e89d26 } return nil } + res["isHardDeleteProtectionEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsHardDeleteProtectionEnabled(val) + } + return nil + } res["keyCredentials"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateKeyCredentialFromDiscriminatorValue) if err != nil { @@ -892,6 +922,19 @@ func (m *Application) GetHomeRealmDiscoveryPolicies() []HomeRealmDiscoveryPolicy return nil } +// GetIdentifierUriConfiguration gets the identifierUriConfiguration property value. The identifierUriConfiguration property +// returns a ApplicationIdentifierUriConfigurationable when successful +func (m *Application) GetIdentifierUriConfiguration() ApplicationIdentifierUriConfigurationable { + val, err := m.GetBackingStore().Get("identifierUriConfiguration") + if err != nil { + panic(err) + } + if val != nil { + return val.(ApplicationIdentifierUriConfigurationable) + } + return nil +} + // GetIdentifierUris gets the identifierUris property value. Also known as App ID URI, this value is set when an application is used as a resource app. The identifierUris acts as the prefix for the scopes you reference in your API's code, and it must be globally unique across Microsoft Entra ID. For more information on valid identifierUris patterns and best practices, see Microsoft Entra application registration security best practices. Not nullable. Supports $filter (eq, ne, ge, le, startsWith). // returns a []string when successful func (m *Application) GetIdentifierUris() []string { @@ -905,6 +948,19 @@ func (m *Application) GetIdentifierUris() []string { return nil } +// GetIdJag gets the idJag property value. The idJag property +// returns a IdJagApplicationConfigurationable when successful +func (m *Application) GetIdJag() IdJagApplicationConfigurationable { + val, err := m.GetBackingStore().Get("idJag") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdJagApplicationConfigurationable) + } + return nil +} + // GetInfo gets the info property value. Basic profile information of the application, such as it's marketing, support, terms of service, and privacy statement URLs. The terms of service and privacy statement are surfaced to users through the user consent experience. For more information, see How to: Add Terms of service and privacy statement for registered Microsoft Entra apps. Supports $filter (eq, ne, not, ge, le, and eq on null values). // returns a InformationalUrlable when successful func (m *Application) GetInfo() InformationalUrlable { @@ -957,6 +1013,19 @@ func (m *Application) GetIsFallbackPublicClient() *bool { return nil } +// GetIsHardDeleteProtectionEnabled gets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the application. When true, permanent deletion is blocked for seven days after soft deletion. The application can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing application by using Update application; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +// returns a *bool when successful +func (m *Application) GetIsHardDeleteProtectionEnabled() *bool { + val, err := m.GetBackingStore().Get("isHardDeleteProtectionEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + // GetKeyCredentials gets the keyCredentials property value. The collection of key credentials associated with the application. Not nullable. Supports $filter (eq, not, ge, le). // returns a []KeyCredentialable when successful func (m *Application) GetKeyCredentials() []KeyCredentialable { @@ -1478,12 +1547,24 @@ func (m *Application) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6 return err } } + { + err = writer.WriteObjectValue("identifierUriConfiguration", m.GetIdentifierUriConfiguration()) + if err != nil { + return err + } + } if m.GetIdentifierUris() != nil { err = writer.WriteCollectionOfStringValues("identifierUris", m.GetIdentifierUris()) if err != nil { return err } } + { + err = writer.WriteObjectValue("idJag", m.GetIdJag()) + if err != nil { + return err + } + } { err = writer.WriteObjectValue("info", m.GetInfo()) if err != nil { @@ -1508,6 +1589,12 @@ func (m *Application) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6 return err } } + { + err = writer.WriteBoolValue("isHardDeleteProtectionEnabled", m.GetIsHardDeleteProtectionEnabled()) + if err != nil { + return err + } + } if m.GetKeyCredentials() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetKeyCredentials())) for i, v := range m.GetKeyCredentials() { @@ -1866,6 +1953,14 @@ func (m *Application) SetHomeRealmDiscoveryPolicies(value []HomeRealmDiscoveryPo } } +// SetIdentifierUriConfiguration sets the identifierUriConfiguration property value. The identifierUriConfiguration property +func (m *Application) SetIdentifierUriConfiguration(value ApplicationIdentifierUriConfigurationable) { + err := m.GetBackingStore().Set("identifierUriConfiguration", value) + if err != nil { + panic(err) + } +} + // SetIdentifierUris sets the identifierUris property value. Also known as App ID URI, this value is set when an application is used as a resource app. The identifierUris acts as the prefix for the scopes you reference in your API's code, and it must be globally unique across Microsoft Entra ID. For more information on valid identifierUris patterns and best practices, see Microsoft Entra application registration security best practices. Not nullable. Supports $filter (eq, ne, ge, le, startsWith). func (m *Application) SetIdentifierUris(value []string) { err := m.GetBackingStore().Set("identifierUris", value) @@ -1874,6 +1969,14 @@ func (m *Application) SetIdentifierUris(value []string) { } } +// SetIdJag sets the idJag property value. The idJag property +func (m *Application) SetIdJag(value IdJagApplicationConfigurationable) { + err := m.GetBackingStore().Set("idJag", value) + if err != nil { + panic(err) + } +} + // SetInfo sets the info property value. Basic profile information of the application, such as it's marketing, support, terms of service, and privacy statement URLs. The terms of service and privacy statement are surfaced to users through the user consent experience. For more information, see How to: Add Terms of service and privacy statement for registered Microsoft Entra apps. Supports $filter (eq, ne, not, ge, le, and eq on null values). func (m *Application) SetInfo(value InformationalUrlable) { err := m.GetBackingStore().Set("info", value) @@ -1906,6 +2009,14 @@ func (m *Application) SetIsFallbackPublicClient(value *bool) { } } +// SetIsHardDeleteProtectionEnabled sets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the application. When true, permanent deletion is blocked for seven days after soft deletion. The application can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing application by using Update application; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +func (m *Application) SetIsHardDeleteProtectionEnabled(value *bool) { + err := m.GetBackingStore().Set("isHardDeleteProtectionEnabled", value) + if err != nil { + panic(err) + } +} + // SetKeyCredentials sets the keyCredentials property value. The collection of key credentials associated with the application. Not nullable. Supports $filter (eq, not, ge, le). func (m *Application) SetKeyCredentials(value []KeyCredentialable) { err := m.GetBackingStore().Set("keyCredentials", value) @@ -2159,11 +2270,14 @@ type Applicationable interface { GetFederatedIdentityCredentials() []FederatedIdentityCredentialable GetGroupMembershipClaims() *string GetHomeRealmDiscoveryPolicies() []HomeRealmDiscoveryPolicyable + GetIdentifierUriConfiguration() ApplicationIdentifierUriConfigurationable GetIdentifierUris() []string + GetIdJag() IdJagApplicationConfigurationable GetInfo() InformationalUrlable GetIsDeviceOnlyAuthSupported() *bool GetIsDisabled() *bool GetIsFallbackPublicClient() *bool + GetIsHardDeleteProtectionEnabled() *bool GetKeyCredentials() []KeyCredentialable GetLogo() []byte GetManagerApplications() []i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID @@ -2211,11 +2325,14 @@ type Applicationable interface { SetFederatedIdentityCredentials(value []FederatedIdentityCredentialable) SetGroupMembershipClaims(value *string) SetHomeRealmDiscoveryPolicies(value []HomeRealmDiscoveryPolicyable) + SetIdentifierUriConfiguration(value ApplicationIdentifierUriConfigurationable) SetIdentifierUris(value []string) + SetIdJag(value IdJagApplicationConfigurationable) SetInfo(value InformationalUrlable) SetIsDeviceOnlyAuthSupported(value *bool) SetIsDisabled(value *bool) SetIsFallbackPublicClient(value *bool) + SetIsHardDeleteProtectionEnabled(value *bool) SetKeyCredentials(value []KeyCredentialable) SetLogo(value []byte) SetManagerApplications(value []i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) diff --git a/models/application_identifier_uri_configuration.go b/models/application_identifier_uri_configuration.go new file mode 100644 index 00000000000..ccdbc68bb95 --- /dev/null +++ b/models/application_identifier_uri_configuration.go @@ -0,0 +1,204 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ApplicationIdentifierUriConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewApplicationIdentifierUriConfiguration instantiates a new ApplicationIdentifierUriConfiguration and sets the default values. +func NewApplicationIdentifierUriConfiguration() *ApplicationIdentifierUriConfiguration { + m := &ApplicationIdentifierUriConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateApplicationIdentifierUriConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApplicationIdentifierUriConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApplicationIdentifierUriConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ApplicationIdentifierUriConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ApplicationIdentifierUriConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ApplicationIdentifierUriConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["idJag"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdJagIdentifierUriConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIdJag(val.(IdJagIdentifierUriConfigurationable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["saml"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSamlIdentifierUriConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSaml(val.(SamlIdentifierUriConfigurationable)) + } + return nil + } + return res +} + +// GetIdJag gets the idJag property value. The idJag property +// returns a IdJagIdentifierUriConfigurationable when successful +func (m *ApplicationIdentifierUriConfiguration) GetIdJag() IdJagIdentifierUriConfigurationable { + val, err := m.GetBackingStore().Get("idJag") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdJagIdentifierUriConfigurationable) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ApplicationIdentifierUriConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSaml gets the saml property value. The saml property +// returns a SamlIdentifierUriConfigurationable when successful +func (m *ApplicationIdentifierUriConfiguration) GetSaml() SamlIdentifierUriConfigurationable { + val, err := m.GetBackingStore().Get("saml") + if err != nil { + panic(err) + } + if val != nil { + return val.(SamlIdentifierUriConfigurationable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ApplicationIdentifierUriConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("idJag", m.GetIdJag()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("saml", m.GetSaml()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ApplicationIdentifierUriConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ApplicationIdentifierUriConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetIdJag sets the idJag property value. The idJag property +func (m *ApplicationIdentifierUriConfiguration) SetIdJag(value IdJagIdentifierUriConfigurationable) { + err := m.GetBackingStore().Set("idJag", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ApplicationIdentifierUriConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetSaml sets the saml property value. The saml property +func (m *ApplicationIdentifierUriConfiguration) SetSaml(value SamlIdentifierUriConfigurationable) { + err := m.GetBackingStore().Set("saml", value) + if err != nil { + panic(err) + } +} + +type ApplicationIdentifierUriConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetIdJag() IdJagIdentifierUriConfigurationable + GetOdataType() *string + GetSaml() SamlIdentifierUriConfigurationable + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetIdJag(value IdJagIdentifierUriConfigurationable) + SetOdataType(value *string) + SetSaml(value SamlIdentifierUriConfigurationable) +} diff --git a/models/applied_conditional_access_policy.go b/models/applied_conditional_access_policy.go index a935186143c..e4e388dd33e 100644 --- a/models/applied_conditional_access_policy.go +++ b/models/applied_conditional_access_policy.go @@ -334,7 +334,7 @@ func (m *AppliedConditionalAccessPolicy) GetOdataType() *string { return nil } -// GetResult gets the result property value. Indicates the result of the CA policy that was triggered. The possible values are: success, failure, notApplied (policy isn't applied because policy conditions weren't met), notEnabled (this is due to the policy in a disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. Use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. +// GetResult gets the result property value. Indicates the result of the CA policy that was triggered. The possible values are: success, failure, notApplied (policy isn't applied because policy conditions weren't met), notEnabled (this is due to the policy in a disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted, notAppliedAllAppsExclusion, reportOnlyNotAppliedAllAppsExclusion. Use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted, notAppliedAllAppsExclusion, reportOnlyNotAppliedAllAppsExclusion. The notAppliedAllAppsExclusion and reportOnlyNotAppliedAllAppsExclusion values indicate that an enabled all-apps exclusion skipped an enabled policy or a report-only policy, respectively. In these values, reportOnly refers to the policy's mode, not the exclusion's mode. If the exclusion itself is in report-only mode, policy evaluation continues normally and neither exclusion-specific result applies. // returns a *AppliedConditionalAccessPolicyResult when successful func (m *AppliedConditionalAccessPolicy) GetResult() *AppliedConditionalAccessPolicyResult { val, err := m.GetBackingStore().Get("result") @@ -551,7 +551,7 @@ func (m *AppliedConditionalAccessPolicy) SetOdataType(value *string) { } } -// SetResult sets the result property value. Indicates the result of the CA policy that was triggered. The possible values are: success, failure, notApplied (policy isn't applied because policy conditions weren't met), notEnabled (this is due to the policy in a disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. Use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted. +// SetResult sets the result property value. Indicates the result of the CA policy that was triggered. The possible values are: success, failure, notApplied (policy isn't applied because policy conditions weren't met), notEnabled (this is due to the policy in a disabled state), unknown, unknownFutureValue, reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted, notAppliedAllAppsExclusion, reportOnlyNotAppliedAllAppsExclusion. Use the Prefer: include-unknown-enum-members request header to get the following values in this evolvable enum: reportOnlySuccess, reportOnlyFailure, reportOnlyNotApplied, reportOnlyInterrupted, notAppliedAllAppsExclusion, reportOnlyNotAppliedAllAppsExclusion. The notAppliedAllAppsExclusion and reportOnlyNotAppliedAllAppsExclusion values indicate that an enabled all-apps exclusion skipped an enabled policy or a report-only policy, respectively. In these values, reportOnly refers to the policy's mode, not the exclusion's mode. If the exclusion itself is in report-only mode, policy evaluation continues normally and neither exclusion-specific result applies. func (m *AppliedConditionalAccessPolicy) SetResult(value *AppliedConditionalAccessPolicyResult) { err := m.GetBackingStore().Set("result", value) if err != nil { diff --git a/models/applied_conditional_access_policy_result.go b/models/applied_conditional_access_policy_result.go index 846967909d3..e4ed14d225d 100644 --- a/models/applied_conditional_access_policy_result.go +++ b/models/applied_conditional_access_policy_result.go @@ -16,10 +16,12 @@ const ( REPORTONLYFAILURE_APPLIEDCONDITIONALACCESSPOLICYRESULT REPORTONLYNOTAPPLIED_APPLIEDCONDITIONALACCESSPOLICYRESULT REPORTONLYINTERRUPTED_APPLIEDCONDITIONALACCESSPOLICYRESULT + NOTAPPLIEDALLAPPSEXCLUSION_APPLIEDCONDITIONALACCESSPOLICYRESULT + REPORTONLYNOTAPPLIEDALLAPPSEXCLUSION_APPLIEDCONDITIONALACCESSPOLICYRESULT ) func (i AppliedConditionalAccessPolicyResult) String() string { - return []string{"success", "failure", "notApplied", "notEnabled", "unknown", "unknownFutureValue", "reportOnlySuccess", "reportOnlyFailure", "reportOnlyNotApplied", "reportOnlyInterrupted"}[i] + return []string{"success", "failure", "notApplied", "notEnabled", "unknown", "unknownFutureValue", "reportOnlySuccess", "reportOnlyFailure", "reportOnlyNotApplied", "reportOnlyInterrupted", "notAppliedAllAppsExclusion", "reportOnlyNotAppliedAllAppsExclusion"}[i] } func ParseAppliedConditionalAccessPolicyResult(v string) (any, error) { @@ -45,6 +47,10 @@ func ParseAppliedConditionalAccessPolicyResult(v string) (any, error) { result = REPORTONLYNOTAPPLIED_APPLIEDCONDITIONALACCESSPOLICYRESULT case "reportOnlyInterrupted": result = REPORTONLYINTERRUPTED_APPLIEDCONDITIONALACCESSPOLICYRESULT + case "notAppliedAllAppsExclusion": + result = NOTAPPLIEDALLAPPSEXCLUSION_APPLIEDCONDITIONALACCESSPOLICYRESULT + case "reportOnlyNotAppliedAllAppsExclusion": + result = REPORTONLYNOTAPPLIEDALLAPPSEXCLUSION_APPLIEDCONDITIONALACCESSPOLICYRESULT default: return nil, nil } diff --git a/models/assigned_policy_reference.go b/models/assigned_policy_reference.go new file mode 100644 index 00000000000..c01e3c0869e --- /dev/null +++ b/models/assigned_policy_reference.go @@ -0,0 +1,144 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type AssignedPolicyReference struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewAssignedPolicyReference instantiates a new AssignedPolicyReference and sets the default values. +func NewAssignedPolicyReference() *AssignedPolicyReference { + m := &AssignedPolicyReference{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateAssignedPolicyReferenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAssignedPolicyReferenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("@odata.type") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + switch *mappingValue { + case "#microsoft.graph.policyDefinitionReference": + return NewPolicyDefinitionReference(), nil + } + } + } + } + return NewAssignedPolicyReference(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *AssignedPolicyReference) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *AssignedPolicyReference) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *AssignedPolicyReference) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *AssignedPolicyReference) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *AssignedPolicyReference) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *AssignedPolicyReference) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *AssignedPolicyReference) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *AssignedPolicyReference) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type AssignedPolicyReferenceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/audit_log_root.go b/models/audit_log_root.go index aae900dbc9c..5773698cb59 100644 --- a/models/audit_log_root.go +++ b/models/audit_log_root.go @@ -193,6 +193,22 @@ func (m *AuditLogRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d2 } return nil } + res["resourcePolicy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyEvaluationEventFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyEvaluationEventable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyEvaluationEventable) + } + } + m.SetResourcePolicy(res) + } + return nil + } res["signInEventsAppSummary"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateSignInEventsAppActivityFromDiscriminatorValue) if err != nil { @@ -286,6 +302,19 @@ func (m *AuditLogRoot) GetProvisioning() []ProvisioningObjectSummaryable { return nil } +// GetResourcePolicy gets the resourcePolicy property value. The resourcePolicy property +// returns a []ResourcePolicyEvaluationEventable when successful +func (m *AuditLogRoot) GetResourcePolicy() []ResourcePolicyEvaluationEventable { + val, err := m.GetBackingStore().Get("resourcePolicy") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyEvaluationEventable) + } + return nil +} + // GetSignInEventsAppSummary gets the signInEventsAppSummary property value. Represents the number of sign-in events for a specific application. // returns a []SignInEventsAppActivityable when successful func (m *AuditLogRoot) GetSignInEventsAppSummary() []SignInEventsAppActivityable { @@ -406,6 +435,18 @@ func (m *AuditLogRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e return err } } + if m.GetResourcePolicy() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetResourcePolicy())) + for i, v := range m.GetResourcePolicy() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("resourcePolicy", cast) + if err != nil { + return err + } + } if m.GetSignInEventsAppSummary() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSignInEventsAppSummary())) for i, v := range m.GetSignInEventsAppSummary() { @@ -524,6 +565,14 @@ func (m *AuditLogRoot) SetProvisioning(value []ProvisioningObjectSummaryable) { } } +// SetResourcePolicy sets the resourcePolicy property value. The resourcePolicy property +func (m *AuditLogRoot) SetResourcePolicy(value []ResourcePolicyEvaluationEventable) { + err := m.GetBackingStore().Set("resourcePolicy", value) + if err != nil { + panic(err) + } +} + // SetSignInEventsAppSummary sets the signInEventsAppSummary property value. Represents the number of sign-in events for a specific application. func (m *AuditLogRoot) SetSignInEventsAppSummary(value []SignInEventsAppActivityable) { err := m.GetBackingStore().Set("signInEventsAppSummary", value) @@ -567,6 +616,7 @@ type AuditLogRootable interface { GetDirectoryProvisioning() []ProvisioningObjectSummaryable GetOdataType() *string GetProvisioning() []ProvisioningObjectSummaryable + GetResourcePolicy() []ResourcePolicyEvaluationEventable GetSignInEventsAppSummary() []SignInEventsAppActivityable GetSignInEventsSummary() []SignInEventsActivityable GetSignIns() []SignInable @@ -578,6 +628,7 @@ type AuditLogRootable interface { SetDirectoryProvisioning(value []ProvisioningObjectSummaryable) SetOdataType(value *string) SetProvisioning(value []ProvisioningObjectSummaryable) + SetResourcePolicy(value []ResourcePolicyEvaluationEventable) SetSignInEventsAppSummary(value []SignInEventsAppActivityable) SetSignInEventsSummary(value []SignInEventsActivityable) SetSignIns(value []SignInable) diff --git a/models/authentication_method.go b/models/authentication_method.go index 8bedfcd796d..6b8786d93c2 100644 --- a/models/authentication_method.go +++ b/models/authentication_method.go @@ -107,6 +107,16 @@ func (m *AuthenticationMethod) GetFieldDeserializers() map[string]func(i878a80d2 } return nil } + res["provenance"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCredentialProvenanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProvenance(val.(CredentialProvenanceable)) + } + return nil + } return res } @@ -123,6 +133,19 @@ func (m *AuthenticationMethod) GetLastUsedDateTime() *i336074805fc853987abe6f7fe return nil } +// GetProvenance gets the provenance property value. The provenance and trust classification of the authentication method. Supports administrative attestation. Returned for FIDO2 authentication methods; null for method types that don't support provenance. +// returns a CredentialProvenanceable when successful +func (m *AuthenticationMethod) GetProvenance() CredentialProvenanceable { + val, err := m.GetBackingStore().Get("provenance") + if err != nil { + panic(err) + } + if val != nil { + return val.(CredentialProvenanceable) + } + return nil +} + // Serialize serializes information the current object func (m *AuthenticationMethod) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { err := m.Entity.Serialize(writer) @@ -141,6 +164,12 @@ func (m *AuthenticationMethod) Serialize(writer i878a80d2330e89d26896388a3f487ee return err } } + { + err = writer.WriteObjectValue("provenance", m.GetProvenance()) + if err != nil { + return err + } + } return nil } @@ -160,11 +189,21 @@ func (m *AuthenticationMethod) SetLastUsedDateTime(value *i336074805fc853987abe6 } } +// SetProvenance sets the provenance property value. The provenance and trust classification of the authentication method. Supports administrative attestation. Returned for FIDO2 authentication methods; null for method types that don't support provenance. +func (m *AuthenticationMethod) SetProvenance(value CredentialProvenanceable) { + err := m.GetBackingStore().Set("provenance", value) + if err != nil { + panic(err) + } +} + type AuthenticationMethodable interface { Entityable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time GetLastUsedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetProvenance() CredentialProvenanceable SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) SetLastUsedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetProvenance(value CredentialProvenanceable) } diff --git a/models/chain_break_reason.go b/models/chain_break_reason.go new file mode 100644 index 00000000000..81c094db5ca --- /dev/null +++ b/models/chain_break_reason.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ChainBreakReason int + +const ( + NONE_CHAINBREAKREASON ChainBreakReason = iota + IDVREVOKED_CHAINBREAKREASON + SOURCECREDENTIALREVOKED_CHAINBREAKREASON + UNKNOWNFUTUREVALUE_CHAINBREAKREASON +) + +func (i ChainBreakReason) String() string { + return []string{"none", "idvRevoked", "sourceCredentialRevoked", "unknownFutureValue"}[i] +} + +func ParseChainBreakReason(v string) (any, error) { + result := NONE_CHAINBREAKREASON + switch v { + case "none": + result = NONE_CHAINBREAKREASON + case "idvRevoked": + result = IDVREVOKED_CHAINBREAKREASON + case "sourceCredentialRevoked": + result = SOURCECREDENTIALREVOKED_CHAINBREAKREASON + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CHAINBREAKREASON + default: + return nil, nil + } + return &result, nil +} + +func SerializeChainBreakReason(values []ChainBreakReason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ChainBreakReason) isMultiValue() bool { + return false +} diff --git a/models/chain_break_source.go b/models/chain_break_source.go new file mode 100644 index 00000000000..8b740d0b11a --- /dev/null +++ b/models/chain_break_source.go @@ -0,0 +1,49 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ChainBreakSource int + +const ( + NONE_CHAINBREAKSOURCE ChainBreakSource = iota + IDENTITYPROTECTION_CHAINBREAKSOURCE + ADMINACTION_CHAINBREAKSOURCE + SYSTEM_CHAINBREAKSOURCE + UNKNOWNFUTUREVALUE_CHAINBREAKSOURCE +) + +func (i ChainBreakSource) String() string { + return []string{"none", "identityProtection", "adminAction", "system", "unknownFutureValue"}[i] +} + +func ParseChainBreakSource(v string) (any, error) { + result := NONE_CHAINBREAKSOURCE + switch v { + case "none": + result = NONE_CHAINBREAKSOURCE + case "identityProtection": + result = IDENTITYPROTECTION_CHAINBREAKSOURCE + case "adminAction": + result = ADMINACTION_CHAINBREAKSOURCE + case "system": + result = SYSTEM_CHAINBREAKSOURCE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CHAINBREAKSOURCE + default: + return nil, nil + } + return &result, nil +} + +func SerializeChainBreakSource(values []ChainBreakSource) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ChainBreakSource) isMultiValue() bool { + return false +} diff --git a/models/chain_state.go b/models/chain_state.go new file mode 100644 index 00000000000..9b53650723d --- /dev/null +++ b/models/chain_state.go @@ -0,0 +1,43 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ChainState int + +const ( + INTACT_CHAINSTATE ChainState = iota + BROKEN_CHAINSTATE + UNKNOWNFUTUREVALUE_CHAINSTATE +) + +func (i ChainState) String() string { + return []string{"intact", "broken", "unknownFutureValue"}[i] +} + +func ParseChainState(v string) (any, error) { + result := INTACT_CHAINSTATE + switch v { + case "intact": + result = INTACT_CHAINSTATE + case "broken": + result = BROKEN_CHAINSTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CHAINSTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeChainState(values []ChainState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ChainState) isMultiValue() bool { + return false +} diff --git a/models/channel.go b/models/channel.go index 80cf357e4b3..e7549662431 100644 --- a/models/channel.go +++ b/models/channel.go @@ -383,6 +383,22 @@ func (m *Channel) GetFieldDeserializers() map[string]func(i878a80d2330e89d268963 } return nil } + res["tags"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamworkChannelTagFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TeamworkChannelTagable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TeamworkChannelTagable) + } + } + m.SetTags(res) + } + return nil + } res["tenantId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetStringValue() if err != nil { @@ -601,6 +617,19 @@ func (m *Channel) GetTabs() []TeamsTabable { return nil } +// GetTags gets the tags property value. The tags owned by the channel. +// returns a []TeamworkChannelTagable when successful +func (m *Channel) GetTags() []TeamworkChannelTagable { + val, err := m.GetBackingStore().Get("tags") + if err != nil { + panic(err) + } + if val != nil { + return val.([]TeamworkChannelTagable) + } + return nil +} + // GetTenantId gets the tenantId property value. The ID of the Microsoft Entra tenant. // returns a *string when successful func (m *Channel) GetTenantId() *string { @@ -810,6 +839,18 @@ func (m *Channel) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010 return err } } + if m.GetTags() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTags())) + for i, v := range m.GetTags() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("tags", cast) + if err != nil { + return err + } + } { err = writer.WriteStringValue("tenantId", m.GetTenantId()) if err != nil { @@ -1001,6 +1042,14 @@ func (m *Channel) SetTabs(value []TeamsTabable) { } } +// SetTags sets the tags property value. The tags owned by the channel. +func (m *Channel) SetTags(value []TeamworkChannelTagable) { + err := m.GetBackingStore().Set("tags", value) + if err != nil { + panic(err) + } +} + // SetTenantId sets the tenantId property value. The ID of the Microsoft Entra tenant. func (m *Channel) SetTenantId(value *string) { err := m.GetBackingStore().Set("tenantId", value) @@ -1042,6 +1091,7 @@ type Channelable interface { GetSharedWithTeams() []SharedWithChannelTeamInfoable GetSummary() ChannelSummaryable GetTabs() []TeamsTabable + GetTags() []TeamworkChannelTagable GetTenantId() *string GetWebUrl() *string SetAllMembers(value []ConversationMemberable) @@ -1066,6 +1116,7 @@ type Channelable interface { SetSharedWithTeams(value []SharedWithChannelTeamInfoable) SetSummary(value ChannelSummaryable) SetTabs(value []TeamsTabable) + SetTags(value []TeamworkChannelTagable) SetTenantId(value *string) SetWebUrl(value *string) } diff --git a/models/channel_membership_type.go b/models/channel_membership_type.go index 2f7cd484106..51f6c7745de 100644 --- a/models/channel_membership_type.go +++ b/models/channel_membership_type.go @@ -10,10 +10,11 @@ const ( PRIVATE_CHANNELMEMBERSHIPTYPE UNKNOWNFUTUREVALUE_CHANNELMEMBERSHIPTYPE SHARED_CHANNELMEMBERSHIPTYPE + UNTYPED_CHANNELMEMBERSHIPTYPE ) func (i ChannelMembershipType) String() string { - return []string{"standard", "private", "unknownFutureValue", "shared"}[i] + return []string{"standard", "private", "unknownFutureValue", "shared", "unTyped"}[i] } func ParseChannelMembershipType(v string) (any, error) { @@ -27,6 +28,8 @@ func ParseChannelMembershipType(v string) (any, error) { result = UNKNOWNFUTUREVALUE_CHANNELMEMBERSHIPTYPE case "shared": result = SHARED_CHANNELMEMBERSHIPTYPE + case "unTyped": + result = UNTYPED_CHANNELMEMBERSHIPTYPE default: return nil, nil } diff --git a/models/cloud_pc_bulk_action.go b/models/cloud_pc_bulk_action.go index fc2c6dac8d3..71ed69f2742 100644 --- a/models/cloud_pc_bulk_action.go +++ b/models/cloud_pc_bulk_action.go @@ -63,6 +63,8 @@ func CreateCloudPcBulkActionFromDiscriminatorValue(parseNode i878a80d2330e89d268 return NewCloudPcBulkRestart(), nil case "#microsoft.graph.cloudPcBulkRestore": return NewCloudPcBulkRestore(), nil + case "#microsoft.graph.cloudPcBulkSetDeviceName": + return NewCloudPcBulkSetDeviceName(), nil case "#microsoft.graph.cloudPcBulkSetReviewStatus": return NewCloudPcBulkSetReviewStatus(), nil case "#microsoft.graph.cloudPcBulkTroubleshoot": @@ -87,7 +89,7 @@ func (m *CloudPcBulkAction) GetActionSummary() CloudPcBulkActionSummaryable { return nil } -// GetCloudPcIds gets the cloudPcIds property value. The cloudPcIds property +// GetCloudPcIds gets the cloudPcIds property value. IDs of the Cloud PCs the bulk action applies to. Individual Cloud PC IDs are GUID-formatted strings. // returns a []string when successful func (m *CloudPcBulkAction) GetCloudPcIds() []string { val, err := m.GetBackingStore().Get("cloudPcIds") @@ -308,7 +310,7 @@ func (m *CloudPcBulkAction) SetActionSummary(value CloudPcBulkActionSummaryable) } } -// SetCloudPcIds sets the cloudPcIds property value. The cloudPcIds property +// SetCloudPcIds sets the cloudPcIds property value. IDs of the Cloud PCs the bulk action applies to. Individual Cloud PC IDs are GUID-formatted strings. func (m *CloudPcBulkAction) SetCloudPcIds(value []string) { err := m.GetBackingStore().Set("cloudPcIds", value) if err != nil { diff --git a/models/cloud_pc_bulk_set_device_name.go b/models/cloud_pc_bulk_set_device_name.go new file mode 100644 index 00000000000..beec89dc98a --- /dev/null +++ b/models/cloud_pc_bulk_set_device_name.go @@ -0,0 +1,88 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CloudPcBulkSetDeviceName struct { + CloudPcBulkAction +} + +// NewCloudPcBulkSetDeviceName instantiates a new CloudPcBulkSetDeviceName and sets the default values. +func NewCloudPcBulkSetDeviceName() *CloudPcBulkSetDeviceName { + m := &CloudPcBulkSetDeviceName{ + CloudPcBulkAction: *NewCloudPcBulkAction(), + } + odataTypeValue := "#microsoft.graph.cloudPcBulkSetDeviceName" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreateCloudPcBulkSetDeviceNameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCloudPcBulkSetDeviceNameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCloudPcBulkSetDeviceName(), nil +} + +// GetDeviceNamingTemplate gets the deviceNamingTemplate property value. The template used to generate a unique device name for each Cloud PC. Required when creating the action. Use an optional prefix followed by one %RAND:x% macro, where x is the number of random alphanumeric characters and is at least 5. The generated name must be 5–15 characters long. The prefix can contain ASCII letters, digits, and hyphens, and must not start with a hyphen. The prefix length plus x must not exceed 15. For example, ACRA-%RAND:5% generates a ten-character name such as ACRA-A1B2C. +// returns a *string when successful +func (m *CloudPcBulkSetDeviceName) GetDeviceNamingTemplate() *string { + val, err := m.GetBackingStore().Get("deviceNamingTemplate") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CloudPcBulkSetDeviceName) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.CloudPcBulkAction.GetFieldDeserializers() + res["deviceNamingTemplate"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeviceNamingTemplate(val) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *CloudPcBulkSetDeviceName) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.CloudPcBulkAction.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("deviceNamingTemplate", m.GetDeviceNamingTemplate()) + if err != nil { + return err + } + } + return nil +} + +// SetDeviceNamingTemplate sets the deviceNamingTemplate property value. The template used to generate a unique device name for each Cloud PC. Required when creating the action. Use an optional prefix followed by one %RAND:x% macro, where x is the number of random alphanumeric characters and is at least 5. The generated name must be 5–15 characters long. The prefix can contain ASCII letters, digits, and hyphens, and must not start with a hyphen. The prefix length plus x must not exceed 15. For example, ACRA-%RAND:5% generates a ten-character name such as ACRA-A1B2C. +func (m *CloudPcBulkSetDeviceName) SetDeviceNamingTemplate(value *string) { + err := m.GetBackingStore().Set("deviceNamingTemplate", value) + if err != nil { + panic(err) + } +} + +type CloudPcBulkSetDeviceNameable interface { + CloudPcBulkActionable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDeviceNamingTemplate() *string + SetDeviceNamingTemplate(value *string) +} diff --git a/models/cloud_pc_flex_access_configuration.go b/models/cloud_pc_flex_access_configuration.go new file mode 100644 index 00000000000..4e0cafe73d9 --- /dev/null +++ b/models/cloud_pc_flex_access_configuration.go @@ -0,0 +1,166 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type CloudPcFlexAccessConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCloudPcFlexAccessConfiguration instantiates a new CloudPcFlexAccessConfiguration and sets the default values. +func NewCloudPcFlexAccessConfiguration() *CloudPcFlexAccessConfiguration { + m := &CloudPcFlexAccessConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCloudPcFlexAccessConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCloudPcFlexAccessConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCloudPcFlexAccessConfiguration(), nil +} + +// GetAccessState gets the accessState property value. The accessState property +// returns a *CloudPcFlexAccessState when successful +func (m *CloudPcFlexAccessConfiguration) GetAccessState() *CloudPcFlexAccessState { + val, err := m.GetBackingStore().Get("accessState") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CloudPcFlexAccessState) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CloudPcFlexAccessConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CloudPcFlexAccessConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CloudPcFlexAccessConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["accessState"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCloudPcFlexAccessState) + if err != nil { + return err + } + if val != nil { + m.SetAccessState(val.(*CloudPcFlexAccessState)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CloudPcFlexAccessConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *CloudPcFlexAccessConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetAccessState() != nil { + cast := (*m.GetAccessState()).String() + err := writer.WriteStringValue("accessState", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAccessState sets the accessState property value. The accessState property +func (m *CloudPcFlexAccessConfiguration) SetAccessState(value *CloudPcFlexAccessState) { + err := m.GetBackingStore().Set("accessState", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CloudPcFlexAccessConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CloudPcFlexAccessConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CloudPcFlexAccessConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type CloudPcFlexAccessConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessState() *CloudPcFlexAccessState + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetAccessState(value *CloudPcFlexAccessState) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/cloud_pc_flex_access_state.go b/models/cloud_pc_flex_access_state.go new file mode 100644 index 00000000000..7aaf32c7871 --- /dev/null +++ b/models/cloud_pc_flex_access_state.go @@ -0,0 +1,52 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type CloudPcFlexAccessState int + +const ( + UNASSIGNED_CLOUDPCFLEXACCESSSTATE CloudPcFlexAccessState = iota + ACTIVATIONFAILED_CLOUDPCFLEXACCESSSTATE + ACTIVE_CLOUDPCFLEXACCESSSTATE + ACTIVATING_CLOUDPCFLEXACCESSSTATE + STANDBYMODE_CLOUDPCFLEXACCESSSTATE + UNKNOWNFUTUREVALUE_CLOUDPCFLEXACCESSSTATE +) + +func (i CloudPcFlexAccessState) String() string { + return []string{"unassigned", "activationFailed", "active", "activating", "standbyMode", "unknownFutureValue"}[i] +} + +func ParseCloudPcFlexAccessState(v string) (any, error) { + result := UNASSIGNED_CLOUDPCFLEXACCESSSTATE + switch v { + case "unassigned": + result = UNASSIGNED_CLOUDPCFLEXACCESSSTATE + case "activationFailed": + result = ACTIVATIONFAILED_CLOUDPCFLEXACCESSSTATE + case "active": + result = ACTIVE_CLOUDPCFLEXACCESSSTATE + case "activating": + result = ACTIVATING_CLOUDPCFLEXACCESSSTATE + case "standbyMode": + result = STANDBYMODE_CLOUDPCFLEXACCESSSTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CLOUDPCFLEXACCESSSTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeCloudPcFlexAccessState(values []CloudPcFlexAccessState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i CloudPcFlexAccessState) isMultiValue() bool { + return false +} diff --git a/models/cloud_pc_flex_availability_status.go b/models/cloud_pc_flex_availability_status.go new file mode 100644 index 00000000000..fdb3d74af90 --- /dev/null +++ b/models/cloud_pc_flex_availability_status.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type CloudPcFlexAvailabilityStatus int + +const ( + NOTAPPLICABLE_CLOUDPCFLEXAVAILABILITYSTATUS CloudPcFlexAvailabilityStatus = iota + AVAILABLE_CLOUDPCFLEXAVAILABILITYSTATUS + NOTAVAILABLE_CLOUDPCFLEXAVAILABILITYSTATUS + UNKNOWNFUTUREVALUE_CLOUDPCFLEXAVAILABILITYSTATUS +) + +func (i CloudPcFlexAvailabilityStatus) String() string { + return []string{"notApplicable", "available", "notAvailable", "unknownFutureValue"}[i] +} + +func ParseCloudPcFlexAvailabilityStatus(v string) (any, error) { + result := NOTAPPLICABLE_CLOUDPCFLEXAVAILABILITYSTATUS + switch v { + case "notApplicable": + result = NOTAPPLICABLE_CLOUDPCFLEXAVAILABILITYSTATUS + case "available": + result = AVAILABLE_CLOUDPCFLEXAVAILABILITYSTATUS + case "notAvailable": + result = NOTAVAILABLE_CLOUDPCFLEXAVAILABILITYSTATUS + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CLOUDPCFLEXAVAILABILITYSTATUS + default: + return nil, nil + } + return &result, nil +} + +func SerializeCloudPcFlexAvailabilityStatus(values []CloudPcFlexAvailabilityStatus) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i CloudPcFlexAvailabilityStatus) isMultiValue() bool { + return false +} diff --git a/models/cloud_pc_flex_configuration_detail.go b/models/cloud_pc_flex_configuration_detail.go new file mode 100644 index 00000000000..38abd3c6492 --- /dev/null +++ b/models/cloud_pc_flex_configuration_detail.go @@ -0,0 +1,166 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type CloudPcFlexConfigurationDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCloudPcFlexConfigurationDetail instantiates a new CloudPcFlexConfigurationDetail and sets the default values. +func NewCloudPcFlexConfigurationDetail() *CloudPcFlexConfigurationDetail { + m := &CloudPcFlexConfigurationDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCloudPcFlexConfigurationDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCloudPcFlexConfigurationDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCloudPcFlexConfigurationDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CloudPcFlexConfigurationDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CloudPcFlexConfigurationDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CloudPcFlexConfigurationDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["flexCloudPcAvailability"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCloudPcFlexAvailabilityStatus) + if err != nil { + return err + } + if val != nil { + m.SetFlexCloudPcAvailability(val.(*CloudPcFlexAvailabilityStatus)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetFlexCloudPcAvailability gets the flexCloudPcAvailability property value. The flexCloudPcAvailability property +// returns a *CloudPcFlexAvailabilityStatus when successful +func (m *CloudPcFlexConfigurationDetail) GetFlexCloudPcAvailability() *CloudPcFlexAvailabilityStatus { + val, err := m.GetBackingStore().Get("flexCloudPcAvailability") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CloudPcFlexAvailabilityStatus) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CloudPcFlexConfigurationDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *CloudPcFlexConfigurationDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetFlexCloudPcAvailability() != nil { + cast := (*m.GetFlexCloudPcAvailability()).String() + err := writer.WriteStringValue("flexCloudPcAvailability", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CloudPcFlexConfigurationDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CloudPcFlexConfigurationDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetFlexCloudPcAvailability sets the flexCloudPcAvailability property value. The flexCloudPcAvailability property +func (m *CloudPcFlexConfigurationDetail) SetFlexCloudPcAvailability(value *CloudPcFlexAvailabilityStatus) { + err := m.GetBackingStore().Set("flexCloudPcAvailability", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CloudPcFlexConfigurationDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type CloudPcFlexConfigurationDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetFlexCloudPcAvailability() *CloudPcFlexAvailabilityStatus + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetFlexCloudPcAvailability(value *CloudPcFlexAvailabilityStatus) + SetOdataType(value *string) +} diff --git a/models/cloud_pc_remote_action_capability.go b/models/cloud_pc_remote_action_capability.go index 0864adddc31..1258fcae191 100644 --- a/models/cloud_pc_remote_action_capability.go +++ b/models/cloud_pc_remote_action_capability.go @@ -40,7 +40,7 @@ func (m *CloudPcRemoteActionCapability) GetActionCapability() *ActionCapability return nil } -// GetActionName gets the actionName property value. The name of the supported Cloud PC remote action. The possible values are: unknown, restart, rename, restore, resize, reprovision, troubleShoot, changeUserAccountType, placeUnderReview. Default value is unknown. +// GetActionName gets the actionName property value. The name of the supported Cloud PC remote action. The possible values are: unknown, restart, rename, restore, resize, reprovision, troubleShoot, changeUserAccountType, placeUnderReview, unknownFutureValue, setDeviceName. Use the Prefer: include-unknown-enum-members request header to get the following value in this evolvable enum: setDeviceName. The default value is unknown. // returns a *CloudPcRemoteActionName when successful func (m *CloudPcRemoteActionCapability) GetActionName() *CloudPcRemoteActionName { val, err := m.GetBackingStore().Get("actionName") @@ -162,7 +162,7 @@ func (m *CloudPcRemoteActionCapability) SetActionCapability(value *ActionCapabil } } -// SetActionName sets the actionName property value. The name of the supported Cloud PC remote action. The possible values are: unknown, restart, rename, restore, resize, reprovision, troubleShoot, changeUserAccountType, placeUnderReview. Default value is unknown. +// SetActionName sets the actionName property value. The name of the supported Cloud PC remote action. The possible values are: unknown, restart, rename, restore, resize, reprovision, troubleShoot, changeUserAccountType, placeUnderReview, unknownFutureValue, setDeviceName. Use the Prefer: include-unknown-enum-members request header to get the following value in this evolvable enum: setDeviceName. The default value is unknown. func (m *CloudPcRemoteActionCapability) SetActionName(value *CloudPcRemoteActionName) { err := m.GetBackingStore().Set("actionName", value) if err != nil { diff --git a/models/cloud_pc_remote_action_name.go b/models/cloud_pc_remote_action_name.go index ade7940c14a..fc1264c3f34 100644 --- a/models/cloud_pc_remote_action_name.go +++ b/models/cloud_pc_remote_action_name.go @@ -20,10 +20,11 @@ const ( POWERON_CLOUDPCREMOTEACTIONNAME POWEROFF_CLOUDPCREMOTEACTIONNAME MOVEREGION_CLOUDPCREMOTEACTIONNAME + SETDEVICENAME_CLOUDPCREMOTEACTIONNAME ) func (i CloudPcRemoteActionName) String() string { - return []string{"unknown", "restart", "rename", "resize", "restore", "reprovision", "changeUserAccountType", "troubleshoot", "placeUnderReview", "unknownFutureValue", "createSnapshot", "powerOn", "powerOff", "moveRegion"}[i] + return []string{"unknown", "restart", "rename", "resize", "restore", "reprovision", "changeUserAccountType", "troubleshoot", "placeUnderReview", "unknownFutureValue", "createSnapshot", "powerOn", "powerOff", "moveRegion", "setDeviceName"}[i] } func ParseCloudPcRemoteActionName(v string) (any, error) { @@ -57,6 +58,8 @@ func ParseCloudPcRemoteActionName(v string) (any, error) { result = POWEROFF_CLOUDPCREMOTEACTIONNAME case "moveRegion": result = MOVEREGION_CLOUDPCREMOTEACTIONNAME + case "setDeviceName": + result = SETDEVICENAME_CLOUDPCREMOTEACTIONNAME default: return nil, nil } diff --git a/models/conditional_access_exclusions.go b/models/conditional_access_exclusions.go new file mode 100644 index 00000000000..693d4b22e0e --- /dev/null +++ b/models/conditional_access_exclusions.go @@ -0,0 +1,165 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ConditionalAccessExclusions struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewConditionalAccessExclusions instantiates a new ConditionalAccessExclusions and sets the default values. +func NewConditionalAccessExclusions() *ConditionalAccessExclusions { + m := &ConditionalAccessExclusions{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateConditionalAccessExclusionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConditionalAccessExclusionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConditionalAccessExclusions(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ConditionalAccessExclusions) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAllResourcesExclusions gets the allResourcesExclusions property value. The exclusions for Conditional Access policies that target all resources. +// returns a AllResourcesExclusionsable when successful +func (m *ConditionalAccessExclusions) GetAllResourcesExclusions() AllResourcesExclusionsable { + val, err := m.GetBackingStore().Get("allResourcesExclusions") + if err != nil { + panic(err) + } + if val != nil { + return val.(AllResourcesExclusionsable) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ConditionalAccessExclusions) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ConditionalAccessExclusions) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["allResourcesExclusions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAllResourcesExclusionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllResourcesExclusions(val.(AllResourcesExclusionsable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ConditionalAccessExclusions) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ConditionalAccessExclusions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("allResourcesExclusions", m.GetAllResourcesExclusions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ConditionalAccessExclusions) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAllResourcesExclusions sets the allResourcesExclusions property value. The exclusions for Conditional Access policies that target all resources. +func (m *ConditionalAccessExclusions) SetAllResourcesExclusions(value AllResourcesExclusionsable) { + err := m.GetBackingStore().Set("allResourcesExclusions", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ConditionalAccessExclusions) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ConditionalAccessExclusions) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type ConditionalAccessExclusionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllResourcesExclusions() AllResourcesExclusionsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetAllResourcesExclusions(value AllResourcesExclusionsable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/conditional_access_root.go b/models/conditional_access_root.go index 74320dc9019..cf495d28d2f 100644 --- a/models/conditional_access_root.go +++ b/models/conditional_access_root.go @@ -159,6 +159,16 @@ func (m *ConditionalAccessRoot) GetFieldDeserializers() map[string]func(i878a80d } return nil } + res["settings"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateConditionalAccessSettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSettings(val.(ConditionalAccessSettingsable)) + } + return nil + } res["templates"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateConditionalAccessTemplateFromDiscriminatorValue) if err != nil { @@ -204,6 +214,19 @@ func (m *ConditionalAccessRoot) GetPolicies() []ConditionalAccessPolicyable { return nil } +// GetSettings gets the settings property value. The tenant-wide Conditional Access settings, including user-action exclusions. +// returns a ConditionalAccessSettingsable when successful +func (m *ConditionalAccessRoot) GetSettings() ConditionalAccessSettingsable { + val, err := m.GetBackingStore().Get("settings") + if err != nil { + panic(err) + } + if val != nil { + return val.(ConditionalAccessSettingsable) + } + return nil +} + // GetTemplates gets the templates property value. Read-only. Nullable. Returns a collection of the specified Conditional Access templates. // returns a []ConditionalAccessTemplateable when successful func (m *ConditionalAccessRoot) GetTemplates() []ConditionalAccessTemplateable { @@ -277,6 +300,12 @@ func (m *ConditionalAccessRoot) Serialize(writer i878a80d2330e89d26896388a3f487e return err } } + { + err = writer.WriteObjectValue("settings", m.GetSettings()) + if err != nil { + return err + } + } if m.GetTemplates() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTemplates())) for i, v := range m.GetTemplates() { @@ -340,6 +369,14 @@ func (m *ConditionalAccessRoot) SetPolicies(value []ConditionalAccessPolicyable) } } +// SetSettings sets the settings property value. The tenant-wide Conditional Access settings, including user-action exclusions. +func (m *ConditionalAccessRoot) SetSettings(value ConditionalAccessSettingsable) { + err := m.GetBackingStore().Set("settings", value) + if err != nil { + panic(err) + } +} + // SetTemplates sets the templates property value. Read-only. Nullable. Returns a collection of the specified Conditional Access templates. func (m *ConditionalAccessRoot) SetTemplates(value []ConditionalAccessTemplateable) { err := m.GetBackingStore().Set("templates", value) @@ -357,6 +394,7 @@ type ConditionalAccessRootable interface { GetDeletedItems() CaPoliciesDeletableRootable GetNamedLocations() []NamedLocationable GetPolicies() []ConditionalAccessPolicyable + GetSettings() ConditionalAccessSettingsable GetTemplates() []ConditionalAccessTemplateable SetAuthenticationContextClassReferences(value []AuthenticationContextClassReferenceable) SetAuthenticationStrength(value AuthenticationStrengthRootable) @@ -364,5 +402,6 @@ type ConditionalAccessRootable interface { SetDeletedItems(value CaPoliciesDeletableRootable) SetNamedLocations(value []NamedLocationable) SetPolicies(value []ConditionalAccessPolicyable) + SetSettings(value ConditionalAccessSettingsable) SetTemplates(value []ConditionalAccessTemplateable) } diff --git a/models/conditional_access_settings.go b/models/conditional_access_settings.go new file mode 100644 index 00000000000..2a9f37c626e --- /dev/null +++ b/models/conditional_access_settings.go @@ -0,0 +1,126 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ConditionalAccessSettings struct { + Entity +} + +// NewConditionalAccessSettings instantiates a new ConditionalAccessSettings and sets the default values. +func NewConditionalAccessSettings() *ConditionalAccessSettings { + m := &ConditionalAccessSettings{ + Entity: *NewEntity(), + } + return m +} + +// CreateConditionalAccessSettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConditionalAccessSettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConditionalAccessSettings(), nil +} + +// GetExclusions gets the exclusions property value. The tenant-wide exclusions configuration. +// returns a ConditionalAccessExclusionsable when successful +func (m *ConditionalAccessSettings) GetExclusions() ConditionalAccessExclusionsable { + val, err := m.GetBackingStore().Get("exclusions") + if err != nil { + panic(err) + } + if val != nil { + return val.(ConditionalAccessExclusionsable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ConditionalAccessSettings) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["exclusions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateConditionalAccessExclusionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetExclusions(val.(ConditionalAccessExclusionsable)) + } + return nil + } + res["modifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetModifiedDateTime(val) + } + return nil + } + return res +} + +// GetModifiedDateTime gets the modifiedDateTime property value. The date and time the settings were last modified, in ISO 8601 format and UTC. Nullable. Read-only. +// returns a *Time when successful +func (m *ConditionalAccessSettings) GetModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("modifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// Serialize serializes information the current object +func (m *ConditionalAccessSettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("exclusions", m.GetExclusions()) + if err != nil { + return err + } + } + { + err = writer.WriteTimeValue("modifiedDateTime", m.GetModifiedDateTime()) + if err != nil { + return err + } + } + return nil +} + +// SetExclusions sets the exclusions property value. The tenant-wide exclusions configuration. +func (m *ConditionalAccessSettings) SetExclusions(value ConditionalAccessExclusionsable) { + err := m.GetBackingStore().Set("exclusions", value) + if err != nil { + panic(err) + } +} + +// SetModifiedDateTime sets the modifiedDateTime property value. The date and time the settings were last modified, in ISO 8601 format and UTC. Nullable. Read-only. +func (m *ConditionalAccessSettings) SetModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("modifiedDateTime", value) + if err != nil { + panic(err) + } +} + +type ConditionalAccessSettingsable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExclusions() ConditionalAccessExclusionsable + GetModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + SetExclusions(value ConditionalAccessExclusionsable) + SetModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) +} diff --git a/models/configuration_monitor.go b/models/configuration_monitor.go index 30db6e13eaf..f1f3ae80a9c 100644 --- a/models/configuration_monitor.go +++ b/models/configuration_monitor.go @@ -280,7 +280,7 @@ func (m *ConfigurationMonitor) GetMode() *MonitorMode { return nil } -// GetMonitorRunFrequencyInHours gets the monitorRunFrequencyInHours property value. Frequency at which the monitor runs. The default frequency is six hours. Regardless of when you create or update a monitor, it gets triggered within the next 6 hours. Currently, monitors are picked up at fixed times: 6 AM, 12 PM, 6 PM, and 12 AM (all in GMT). For example, if you create a monitor at 9 AM, it gets triggered around 12 PM. If you update a monitor at 4 PM, it gets triggered around 6 PM. +// GetMonitorRunFrequencyInHours gets the monitorRunFrequencyInHours property value. Frequency at which a monitorOnly monitor runs. The default frequency is six hours. Regardless of when you create or update a monitorOnly monitor, it gets triggered within the next 6 hours. Currently, monitors are picked up at fixed times: 6 AM, 12 PM, 6 PM, and 12 AM (all in GMT). For example, if you create a monitor at 9 AM, it gets triggered around 12 PM. If you update a monitor at 4 PM, it gets triggered around 6 PM. This schedule doesn't apply to applyOnce monitors. // returns a *int32 when successful func (m *ConfigurationMonitor) GetMonitorRunFrequencyInHours() *int32 { val, err := m.GetBackingStore().Get("monitorRunFrequencyInHours") @@ -463,7 +463,7 @@ func (m *ConfigurationMonitor) SetMode(value *MonitorMode) { } } -// SetMonitorRunFrequencyInHours sets the monitorRunFrequencyInHours property value. Frequency at which the monitor runs. The default frequency is six hours. Regardless of when you create or update a monitor, it gets triggered within the next 6 hours. Currently, monitors are picked up at fixed times: 6 AM, 12 PM, 6 PM, and 12 AM (all in GMT). For example, if you create a monitor at 9 AM, it gets triggered around 12 PM. If you update a monitor at 4 PM, it gets triggered around 6 PM. +// SetMonitorRunFrequencyInHours sets the monitorRunFrequencyInHours property value. Frequency at which a monitorOnly monitor runs. The default frequency is six hours. Regardless of when you create or update a monitorOnly monitor, it gets triggered within the next 6 hours. Currently, monitors are picked up at fixed times: 6 AM, 12 PM, 6 PM, and 12 AM (all in GMT). For example, if you create a monitor at 9 AM, it gets triggered around 12 PM. If you update a monitor at 4 PM, it gets triggered around 6 PM. This schedule doesn't apply to applyOnce monitors. func (m *ConfigurationMonitor) SetMonitorRunFrequencyInHours(value *int32) { err := m.GetBackingStore().Set("monitorRunFrequencyInHours", value) if err != nil { diff --git a/models/content_link.go b/models/content_link.go index efac3337d54..34e3d435cf7 100644 --- a/models/content_link.go +++ b/models/content_link.go @@ -65,7 +65,7 @@ func (m *ContentLink) GetDisplayName() *string { return nil } -// GetExtensions gets the extensions property value. Custom extension field values set on the entity. Supports $select. +// GetExtensions gets the extensions property value. Custom extension field values set at creation. Can't be changed afterward. Supports $select. // returns a ExtensionFieldCollectionable when successful func (m *ContentLink) GetExtensions() ExtensionFieldCollectionable { val, err := m.GetBackingStore().Get("extensions") @@ -191,7 +191,7 @@ func (m *ContentLink) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97 return nil } -// GetLinkType gets the linkType property value. Type of content the link points to. The possible values are: documentReference, webReference, unknownFutureValue. +// GetLinkType gets the linkType property value. Type of content the link points to. Required at creation and immutable afterward. The possible values are: documentReference, webReference, unknownFutureValue. // returns a *ContentLinkType when successful func (m *ContentLink) GetLinkType() *ContentLinkType { val, err := m.GetBackingStore().Get("linkType") @@ -204,7 +204,7 @@ func (m *ContentLink) GetLinkType() *ContentLinkType { return nil } -// GetWebUrl gets the webUrl property value. URL the link points to. +// GetWebUrl gets the webUrl property value. URL the link points to. Required at creation and immutable afterward. // returns a *string when successful func (m *ContentLink) GetWebUrl() *string { val, err := m.GetBackingStore().Get("webUrl") @@ -287,7 +287,7 @@ func (m *ContentLink) SetDisplayName(value *string) { } } -// SetExtensions sets the extensions property value. Custom extension field values set on the entity. Supports $select. +// SetExtensions sets the extensions property value. Custom extension field values set at creation. Can't be changed afterward. Supports $select. func (m *ContentLink) SetExtensions(value ExtensionFieldCollectionable) { err := m.GetBackingStore().Set("extensions", value) if err != nil { @@ -311,7 +311,7 @@ func (m *ContentLink) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3 } } -// SetLinkType sets the linkType property value. Type of content the link points to. The possible values are: documentReference, webReference, unknownFutureValue. +// SetLinkType sets the linkType property value. Type of content the link points to. Required at creation and immutable afterward. The possible values are: documentReference, webReference, unknownFutureValue. func (m *ContentLink) SetLinkType(value *ContentLinkType) { err := m.GetBackingStore().Set("linkType", value) if err != nil { @@ -319,7 +319,7 @@ func (m *ContentLink) SetLinkType(value *ContentLinkType) { } } -// SetWebUrl sets the webUrl property value. URL the link points to. +// SetWebUrl sets the webUrl property value. URL the link points to. Required at creation and immutable afterward. func (m *ContentLink) SetWebUrl(value *string) { err := m.GetBackingStore().Set("webUrl", value) if err != nil { diff --git a/models/content_management_root.go b/models/content_management_root.go new file mode 100644 index 00000000000..1da1e80284a --- /dev/null +++ b/models/content_management_root.go @@ -0,0 +1,48 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentManagementRoot the contentManagement segment under `/security`. Groups the content-management resources(connected repositories) under a single node. +type ContentManagementRoot struct { + Entity +} + +// NewContentManagementRoot instantiates a new ContentManagementRoot and sets the default values. +func NewContentManagementRoot() *ContentManagementRoot { + m := &ContentManagementRoot{ + Entity: *NewEntity(), + } + return m +} + +// CreateContentManagementRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRoot(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + return res +} + +// Serialize serializes information the current object +func (m *ContentManagementRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + return nil +} + +type ContentManagementRootable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/models/cost_management_funding_class.go b/models/cost_management_funding_class.go new file mode 100644 index 00000000000..99d9d6ab23a --- /dev/null +++ b/models/cost_management_funding_class.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// The funding classification of reported consumption, including unbilled consumption. +type CostManagementFundingClass int + +const ( + // Drawn from a prepaid Copilot Credits pool. + PREPAID_COSTMANAGEMENTFUNDINGCLASS CostManagementFundingClass = iota + // Billed on demand, with no prepaid pool. + PAYASYOUGO_COSTMANAGEMENTFUNDINGCLASS + // Consumed above the purchased pool. Unbilled, not an invoiced excess charge. + OVERAGE_COSTMANAGEMENTFUNDINGCLASS + // Consumed but not billed. + NONBILLABLE_COSTMANAGEMENTFUNDINGCLASS + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_COSTMANAGEMENTFUNDINGCLASS +) + +func (i CostManagementFundingClass) String() string { + return []string{"prepaid", "payAsYouGo", "overage", "nonBillable", "unknownFutureValue"}[i] +} + +func ParseCostManagementFundingClass(v string) (any, error) { + result := PREPAID_COSTMANAGEMENTFUNDINGCLASS + switch v { + case "prepaid": + result = PREPAID_COSTMANAGEMENTFUNDINGCLASS + case "payAsYouGo": + result = PAYASYOUGO_COSTMANAGEMENTFUNDINGCLASS + case "overage": + result = OVERAGE_COSTMANAGEMENTFUNDINGCLASS + case "nonBillable": + result = NONBILLABLE_COSTMANAGEMENTFUNDINGCLASS + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_COSTMANAGEMENTFUNDINGCLASS + default: + return nil, nil + } + return &result, nil +} + +func SerializeCostManagementFundingClass(values []CostManagementFundingClass) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i CostManagementFundingClass) isMultiValue() bool { + return false +} diff --git a/models/cost_management_funding_usage_record.go b/models/cost_management_funding_usage_record.go new file mode 100644 index 00000000000..31a7ffded49 --- /dev/null +++ b/models/cost_management_funding_usage_record.go @@ -0,0 +1,200 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CostManagementFundingUsageRecord one funding class's share of reported consumption for a calendar month. +type CostManagementFundingUsageRecord struct { + Entity +} + +// NewCostManagementFundingUsageRecord instantiates a new CostManagementFundingUsageRecord and sets the default values. +func NewCostManagementFundingUsageRecord() *CostManagementFundingUsageRecord { + m := &CostManagementFundingUsageRecord{ + Entity: *NewEntity(), + } + return m +} + +// CreateCostManagementFundingUsageRecordFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementFundingUsageRecordFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementFundingUsageRecord(), nil +} + +// GetConsumedQuantity gets the consumedQuantity property value. Consumption attributed to this funding class during the requested month, includingunbilled consumption where applicable. Read-only. +// returns a *float64 when successful +func (m *CostManagementFundingUsageRecord) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetDataStatus gets the dataStatus property value. Freshness of the source data behind a Phase 2 usage report result that can report it. +// returns a CostManagementUsageDataStatusable when successful +func (m *CostManagementFundingUsageRecord) GetDataStatus() CostManagementUsageDataStatusable { + val, err := m.GetBackingStore().Get("dataStatus") + if err != nil { + panic(err) + } + if val != nil { + return val.(CostManagementUsageDataStatusable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementFundingUsageRecord) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["dataStatus"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCostManagementUsageDataStatusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDataStatus(val.(CostManagementUsageDataStatusable)) + } + return nil + } + res["fundingClass"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementFundingClass) + if err != nil { + return err + } + if val != nil { + m.SetFundingClass(val.(*CostManagementFundingClass)) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + return res +} + +// GetFundingClass gets the fundingClass property value. The funding classification of reported consumption, including unbilled consumption. +// returns a *CostManagementFundingClass when successful +func (m *CostManagementFundingUsageRecord) GetFundingClass() *CostManagementFundingClass { + val, err := m.GetBackingStore().Get("fundingClass") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementFundingClass) + } + return nil +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementFundingUsageRecord) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementFundingUsageRecord) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("dataStatus", m.GetDataStatus()) + if err != nil { + return err + } + } + if m.GetFundingClass() != nil { + cast := (*m.GetFundingClass()).String() + err = writer.WriteStringValue("fundingClass", &cast) + if err != nil { + return err + } + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err = writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetConsumedQuantity sets the consumedQuantity property value. Consumption attributed to this funding class during the requested month, includingunbilled consumption where applicable. Read-only. +func (m *CostManagementFundingUsageRecord) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetDataStatus sets the dataStatus property value. Freshness of the source data behind a Phase 2 usage report result that can report it. +func (m *CostManagementFundingUsageRecord) SetDataStatus(value CostManagementUsageDataStatusable) { + err := m.GetBackingStore().Set("dataStatus", value) + if err != nil { + panic(err) + } +} + +// SetFundingClass sets the fundingClass property value. The funding classification of reported consumption, including unbilled consumption. +func (m *CostManagementFundingUsageRecord) SetFundingClass(value *CostManagementFundingClass) { + err := m.GetBackingStore().Set("fundingClass", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementFundingUsageRecord) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +type CostManagementFundingUsageRecordable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConsumedQuantity() *float64 + GetDataStatus() CostManagementUsageDataStatusable + GetFundingClass() *CostManagementFundingClass + GetUnit() *CostManagementUnit + SetConsumedQuantity(value *float64) + SetDataStatus(value CostManagementUsageDataStatusable) + SetFundingClass(value *CostManagementFundingClass) + SetUnit(value *CostManagementUnit) +} diff --git a/models/cost_management_group_usage_record.go b/models/cost_management_group_usage_record.go new file mode 100644 index 00000000000..d05053cbbb5 --- /dev/null +++ b/models/cost_management_group_usage_record.go @@ -0,0 +1,266 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// CostManagementGroupUsageRecord one security group's reported consumption for one completed UTC day. +type CostManagementGroupUsageRecord struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCostManagementGroupUsageRecord instantiates a new CostManagementGroupUsageRecord and sets the default values. +func NewCostManagementGroupUsageRecord() *CostManagementGroupUsageRecord { + m := &CostManagementGroupUsageRecord{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCostManagementGroupUsageRecordFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementGroupUsageRecordFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementGroupUsageRecord(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CostManagementGroupUsageRecord) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CostManagementGroupUsageRecord) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetConsumedQuantity gets the consumedQuantity property value. Billable consumption attributed to members of this group for the requested completed UTC day. Read-only. +// returns a *float64 when successful +func (m *CostManagementGroupUsageRecord) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementGroupUsageRecord) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["groupId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGroupId(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["sessionCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetSessionCount(val) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + return res +} + +// GetGroupId gets the groupId property value. The identifier of the security group this row reports. Read-only. +// returns a *string when successful +func (m *CostManagementGroupUsageRecord) GetGroupId() *string { + val, err := m.GetBackingStore().Get("groupId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CostManagementGroupUsageRecord) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSessionCount gets the sessionCount property value. Count of distinct non-null session identifiers on billable activity attributed to this groupduring the requested completed UTC day, subject to the source filters and plan processingwatermarks. Excludes non-billable activity. Read-only. +// returns a *int64 when successful +func (m *CostManagementGroupUsageRecord) GetSessionCount() *int64 { + val, err := m.GetBackingStore().Get("sessionCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int64) + } + return nil +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementGroupUsageRecord) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementGroupUsageRecord) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err := writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CostManagementGroupUsageRecord) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CostManagementGroupUsageRecord) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetConsumedQuantity sets the consumedQuantity property value. Billable consumption attributed to members of this group for the requested completed UTC day. Read-only. +func (m *CostManagementGroupUsageRecord) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetGroupId sets the groupId property value. The identifier of the security group this row reports. Read-only. +func (m *CostManagementGroupUsageRecord) SetGroupId(value *string) { + err := m.GetBackingStore().Set("groupId", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CostManagementGroupUsageRecord) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetSessionCount sets the sessionCount property value. Count of distinct non-null session identifiers on billable activity attributed to this groupduring the requested completed UTC day, subject to the source filters and plan processingwatermarks. Excludes non-billable activity. Read-only. +func (m *CostManagementGroupUsageRecord) SetSessionCount(value *int64) { + err := m.GetBackingStore().Set("sessionCount", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementGroupUsageRecord) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +type CostManagementGroupUsageRecordable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetConsumedQuantity() *float64 + GetGroupId() *string + GetOdataType() *string + GetSessionCount() *int64 + GetUnit() *CostManagementUnit + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetConsumedQuantity(value *float64) + SetGroupId(value *string) + SetOdataType(value *string) + SetSessionCount(value *int64) + SetUnit(value *CostManagementUnit) +} diff --git a/models/cost_management_root.go b/models/cost_management_root.go index 24ef1f01888..92106d674a6 100644 --- a/models/cost_management_root.go +++ b/models/cost_management_root.go @@ -26,10 +26,39 @@ func CreateCostManagementRootFromDiscriminatorValue(parseNode i878a80d2330e89d26 return NewCostManagementRoot(), nil } +// GetCreditRequests gets the creditRequests property value. The collection of credit requests for this tenant. Excludes audit-only requests by default.A list or requested-count dependency failure returns a Graph serviceNotAvailable error.Supports $filter on state and serviceId (eq), $select, $count=true, and $top (default 50, maximum 200).Results are ordered newest-first; $orderby is not supported.Server-driven paging returns an OData nextLink when additional pages are available. +// returns a []CreditRequestable when successful +func (m *CostManagementRoot) GetCreditRequests() []CreditRequestable { + val, err := m.GetBackingStore().Get("creditRequests") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CreditRequestable) + } + return nil +} + // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful func (m *CostManagementRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { res := m.Entity.GetFieldDeserializers() + res["creditRequests"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCreditRequestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CreditRequestable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CreditRequestable) + } + } + m.SetCreditRequests(res) + } + return nil + } res["spendingPolicies"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateSpendingPolicyFromDiscriminatorValue) if err != nil { @@ -46,6 +75,16 @@ func (m *CostManagementRoot) GetFieldDeserializers() map[string]func(i878a80d233 } return nil } + res["usageReports"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCostManagementUsageReportRootFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUsageReports(val.(CostManagementUsageReportRootable)) + } + return nil + } res["userBalances"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateCostManagementUserBalanceFromDiscriminatorValue) if err != nil { @@ -78,6 +117,19 @@ func (m *CostManagementRoot) GetSpendingPolicies() []SpendingPolicyable { return nil } +// GetUsageReports gets the usageReports property value. Reported consumption of Copilot Credits, split by user, group, service and funding. +// returns a CostManagementUsageReportRootable when successful +func (m *CostManagementRoot) GetUsageReports() CostManagementUsageReportRootable { + val, err := m.GetBackingStore().Get("usageReports") + if err != nil { + panic(err) + } + if val != nil { + return val.(CostManagementUsageReportRootable) + } + return nil +} + // GetUserBalances gets the userBalances property value. Per-user consumption balances, addressed by the user's identifier. // returns a []CostManagementUserBalanceable when successful func (m *CostManagementRoot) GetUserBalances() []CostManagementUserBalanceable { @@ -97,6 +149,18 @@ func (m *CostManagementRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef2 if err != nil { return err } + if m.GetCreditRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCreditRequests())) + for i, v := range m.GetCreditRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("creditRequests", cast) + if err != nil { + return err + } + } if m.GetSpendingPolicies() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSpendingPolicies())) for i, v := range m.GetSpendingPolicies() { @@ -109,6 +173,12 @@ func (m *CostManagementRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef2 return err } } + { + err = writer.WriteObjectValue("usageReports", m.GetUsageReports()) + if err != nil { + return err + } + } if m.GetUserBalances() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUserBalances())) for i, v := range m.GetUserBalances() { @@ -124,6 +194,14 @@ func (m *CostManagementRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef2 return nil } +// SetCreditRequests sets the creditRequests property value. The collection of credit requests for this tenant. Excludes audit-only requests by default.A list or requested-count dependency failure returns a Graph serviceNotAvailable error.Supports $filter on state and serviceId (eq), $select, $count=true, and $top (default 50, maximum 200).Results are ordered newest-first; $orderby is not supported.Server-driven paging returns an OData nextLink when additional pages are available. +func (m *CostManagementRoot) SetCreditRequests(value []CreditRequestable) { + err := m.GetBackingStore().Set("creditRequests", value) + if err != nil { + panic(err) + } +} + // SetSpendingPolicies sets the spendingPolicies property value. The spending policies that govern Copilot Credits consumption. func (m *CostManagementRoot) SetSpendingPolicies(value []SpendingPolicyable) { err := m.GetBackingStore().Set("spendingPolicies", value) @@ -132,6 +210,14 @@ func (m *CostManagementRoot) SetSpendingPolicies(value []SpendingPolicyable) { } } +// SetUsageReports sets the usageReports property value. Reported consumption of Copilot Credits, split by user, group, service and funding. +func (m *CostManagementRoot) SetUsageReports(value CostManagementUsageReportRootable) { + err := m.GetBackingStore().Set("usageReports", value) + if err != nil { + panic(err) + } +} + // SetUserBalances sets the userBalances property value. Per-user consumption balances, addressed by the user's identifier. func (m *CostManagementRoot) SetUserBalances(value []CostManagementUserBalanceable) { err := m.GetBackingStore().Set("userBalances", value) @@ -143,8 +229,12 @@ func (m *CostManagementRoot) SetUserBalances(value []CostManagementUserBalanceab type CostManagementRootable interface { Entityable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreditRequests() []CreditRequestable GetSpendingPolicies() []SpendingPolicyable + GetUsageReports() CostManagementUsageReportRootable GetUserBalances() []CostManagementUserBalanceable + SetCreditRequests(value []CreditRequestable) SetSpendingPolicies(value []SpendingPolicyable) + SetUsageReports(value CostManagementUsageReportRootable) SetUserBalances(value []CostManagementUserBalanceable) } diff --git a/models/cost_management_service_usage_record.go b/models/cost_management_service_usage_record.go new file mode 100644 index 00000000000..619e82b9152 --- /dev/null +++ b/models/cost_management_service_usage_record.go @@ -0,0 +1,233 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// CostManagementServiceUsageRecord one service's share of reported consumption for one completed UTC day. +type CostManagementServiceUsageRecord struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCostManagementServiceUsageRecord instantiates a new CostManagementServiceUsageRecord and sets the default values. +func NewCostManagementServiceUsageRecord() *CostManagementServiceUsageRecord { + m := &CostManagementServiceUsageRecord{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCostManagementServiceUsageRecordFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementServiceUsageRecordFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementServiceUsageRecord(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CostManagementServiceUsageRecord) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CostManagementServiceUsageRecord) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetConsumedQuantity gets the consumedQuantity property value. Consumption attributed to this service for the requested completed UTC day. Read-only. +// returns a *float64 when successful +func (m *CostManagementServiceUsageRecord) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementServiceUsageRecord) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["serviceId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServiceId(val) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CostManagementServiceUsageRecord) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetServiceId gets the serviceId property value. The governed service identifier, such as cowork or workIQ. Discover valid values from theservice catalog using a category identifier, not the catalog entry's own id. Read-only. +// returns a *string when successful +func (m *CostManagementServiceUsageRecord) GetServiceId() *string { + val, err := m.GetBackingStore().Get("serviceId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementServiceUsageRecord) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementServiceUsageRecord) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err := writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CostManagementServiceUsageRecord) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CostManagementServiceUsageRecord) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetConsumedQuantity sets the consumedQuantity property value. Consumption attributed to this service for the requested completed UTC day. Read-only. +func (m *CostManagementServiceUsageRecord) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CostManagementServiceUsageRecord) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetServiceId sets the serviceId property value. The governed service identifier, such as cowork or workIQ. Discover valid values from theservice catalog using a category identifier, not the catalog entry's own id. Read-only. +func (m *CostManagementServiceUsageRecord) SetServiceId(value *string) { + err := m.GetBackingStore().Set("serviceId", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementServiceUsageRecord) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +type CostManagementServiceUsageRecordable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetConsumedQuantity() *float64 + GetOdataType() *string + GetServiceId() *string + GetUnit() *CostManagementUnit + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetConsumedQuantity(value *float64) + SetOdataType(value *string) + SetServiceId(value *string) + SetUnit(value *CostManagementUnit) +} diff --git a/models/cost_management_usage_data_status.go b/models/cost_management_usage_data_status.go new file mode 100644 index 00000000000..959c73c09c1 --- /dev/null +++ b/models/cost_management_usage_data_status.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// CostManagementUsageDataStatus freshness of the source data behind a Phase 2 usage report result that can report it. +type CostManagementUsageDataStatus struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCostManagementUsageDataStatus instantiates a new CostManagementUsageDataStatus and sets the default values. +func NewCostManagementUsageDataStatus() *CostManagementUsageDataStatus { + m := &CostManagementUsageDataStatus{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCostManagementUsageDataStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementUsageDataStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementUsageDataStatus(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CostManagementUsageDataStatus) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CostManagementUsageDataStatus) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementUsageDataStatus) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["latestSourceDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLatestSourceDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetLatestSourceDateTime gets the latestSourceDateTime property value. Timestamp of the latest source event or snapshot sync run incorporated into this result,where the operation can report one. Meaning is operation-specific - see the property thatreferences this type. Does not indicate the result is complete or that the covered periodhas closed; a later read over the same window may return a later value or additional rows. +// returns a *Time when successful +func (m *CostManagementUsageDataStatus) GetLatestSourceDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("latestSourceDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CostManagementUsageDataStatus) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementUsageDataStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteTimeValue("latestSourceDateTime", m.GetLatestSourceDateTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CostManagementUsageDataStatus) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CostManagementUsageDataStatus) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetLatestSourceDateTime sets the latestSourceDateTime property value. Timestamp of the latest source event or snapshot sync run incorporated into this result,where the operation can report one. Meaning is operation-specific - see the property thatreferences this type. Does not indicate the result is complete or that the covered periodhas closed; a later read over the same window may return a later value or additional rows. +func (m *CostManagementUsageDataStatus) SetLatestSourceDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("latestSourceDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CostManagementUsageDataStatus) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type CostManagementUsageDataStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetLatestSourceDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetLatestSourceDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) +} diff --git a/models/cost_management_usage_report_root.go b/models/cost_management_usage_report_root.go new file mode 100644 index 00000000000..3a56efa12f9 --- /dev/null +++ b/models/cost_management_usage_report_root.go @@ -0,0 +1,303 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CostManagementUsageReportRoot the Copilot Cost Management usage reporting root. +type CostManagementUsageReportRoot struct { + Entity +} + +// NewCostManagementUsageReportRoot instantiates a new CostManagementUsageReportRoot and sets the default values. +func NewCostManagementUsageReportRoot() *CostManagementUsageReportRoot { + m := &CostManagementUsageReportRoot{ + Entity: *NewEntity(), + } + return m +} + +// CreateCostManagementUsageReportRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementUsageReportRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementUsageReportRoot(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementUsageReportRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["fundingUsageRecords"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementFundingUsageRecordFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementFundingUsageRecordable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementFundingUsageRecordable) + } + } + m.SetFundingUsageRecords(res) + } + return nil + } + res["groupUsageRecords"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementGroupUsageRecordFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementGroupUsageRecordable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementGroupUsageRecordable) + } + } + m.SetGroupUsageRecords(res) + } + return nil + } + res["serviceUsageRecords"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementServiceUsageRecordFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementServiceUsageRecordable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementServiceUsageRecordable) + } + } + m.SetServiceUsageRecords(res) + } + return nil + } + res["userUsageDetails"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementUserUsageDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementUserUsageDetailable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementUserUsageDetailable) + } + } + m.SetUserUsageDetails(res) + } + return nil + } + res["userUsageRecords"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementUserUsageRecordFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementUserUsageRecordable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementUserUsageRecordable) + } + } + m.SetUserUsageRecords(res) + } + return nil + } + return res +} + +// GetFundingUsageRecords gets the fundingUsageRecords property value. Reported consumption per funding class for a calendar month. +// returns a []CostManagementFundingUsageRecordable when successful +func (m *CostManagementUsageReportRoot) GetFundingUsageRecords() []CostManagementFundingUsageRecordable { + val, err := m.GetBackingStore().Get("fundingUsageRecords") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementFundingUsageRecordable) + } + return nil +} + +// GetGroupUsageRecords gets the groupUsageRecords property value. Reported consumption per security group for one completed UTC day. +// returns a []CostManagementGroupUsageRecordable when successful +func (m *CostManagementUsageReportRoot) GetGroupUsageRecords() []CostManagementGroupUsageRecordable { + val, err := m.GetBackingStore().Get("groupUsageRecords") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementGroupUsageRecordable) + } + return nil +} + +// GetServiceUsageRecords gets the serviceUsageRecords property value. Reported consumption per governed service for one completed UTC day. +// returns a []CostManagementServiceUsageRecordable when successful +func (m *CostManagementUsageReportRoot) GetServiceUsageRecords() []CostManagementServiceUsageRecordable { + val, err := m.GetBackingStore().Get("serviceUsageRecords") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementServiceUsageRecordable) + } + return nil +} + +// GetUserUsageDetails gets the userUsageDetails property value. Raw per-user usage detail, read one user at a time. +// returns a []CostManagementUserUsageDetailable when successful +func (m *CostManagementUsageReportRoot) GetUserUsageDetails() []CostManagementUserUsageDetailable { + val, err := m.GetBackingStore().Get("userUsageDetails") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementUserUsageDetailable) + } + return nil +} + +// GetUserUsageRecords gets the userUsageRecords property value. Reported consumption per user for one completed UTC day, ranked by consumption. +// returns a []CostManagementUserUsageRecordable when successful +func (m *CostManagementUsageReportRoot) GetUserUsageRecords() []CostManagementUserUsageRecordable { + val, err := m.GetBackingStore().Get("userUsageRecords") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementUserUsageRecordable) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementUsageReportRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetFundingUsageRecords() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFundingUsageRecords())) + for i, v := range m.GetFundingUsageRecords() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("fundingUsageRecords", cast) + if err != nil { + return err + } + } + if m.GetGroupUsageRecords() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetGroupUsageRecords())) + for i, v := range m.GetGroupUsageRecords() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("groupUsageRecords", cast) + if err != nil { + return err + } + } + if m.GetServiceUsageRecords() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetServiceUsageRecords())) + for i, v := range m.GetServiceUsageRecords() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("serviceUsageRecords", cast) + if err != nil { + return err + } + } + if m.GetUserUsageDetails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUserUsageDetails())) + for i, v := range m.GetUserUsageDetails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("userUsageDetails", cast) + if err != nil { + return err + } + } + if m.GetUserUsageRecords() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUserUsageRecords())) + for i, v := range m.GetUserUsageRecords() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("userUsageRecords", cast) + if err != nil { + return err + } + } + return nil +} + +// SetFundingUsageRecords sets the fundingUsageRecords property value. Reported consumption per funding class for a calendar month. +func (m *CostManagementUsageReportRoot) SetFundingUsageRecords(value []CostManagementFundingUsageRecordable) { + err := m.GetBackingStore().Set("fundingUsageRecords", value) + if err != nil { + panic(err) + } +} + +// SetGroupUsageRecords sets the groupUsageRecords property value. Reported consumption per security group for one completed UTC day. +func (m *CostManagementUsageReportRoot) SetGroupUsageRecords(value []CostManagementGroupUsageRecordable) { + err := m.GetBackingStore().Set("groupUsageRecords", value) + if err != nil { + panic(err) + } +} + +// SetServiceUsageRecords sets the serviceUsageRecords property value. Reported consumption per governed service for one completed UTC day. +func (m *CostManagementUsageReportRoot) SetServiceUsageRecords(value []CostManagementServiceUsageRecordable) { + err := m.GetBackingStore().Set("serviceUsageRecords", value) + if err != nil { + panic(err) + } +} + +// SetUserUsageDetails sets the userUsageDetails property value. Raw per-user usage detail, read one user at a time. +func (m *CostManagementUsageReportRoot) SetUserUsageDetails(value []CostManagementUserUsageDetailable) { + err := m.GetBackingStore().Set("userUsageDetails", value) + if err != nil { + panic(err) + } +} + +// SetUserUsageRecords sets the userUsageRecords property value. Reported consumption per user for one completed UTC day, ranked by consumption. +func (m *CostManagementUsageReportRoot) SetUserUsageRecords(value []CostManagementUserUsageRecordable) { + err := m.GetBackingStore().Set("userUsageRecords", value) + if err != nil { + panic(err) + } +} + +type CostManagementUsageReportRootable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFundingUsageRecords() []CostManagementFundingUsageRecordable + GetGroupUsageRecords() []CostManagementGroupUsageRecordable + GetServiceUsageRecords() []CostManagementServiceUsageRecordable + GetUserUsageDetails() []CostManagementUserUsageDetailable + GetUserUsageRecords() []CostManagementUserUsageRecordable + SetFundingUsageRecords(value []CostManagementFundingUsageRecordable) + SetGroupUsageRecords(value []CostManagementGroupUsageRecordable) + SetServiceUsageRecords(value []CostManagementServiceUsageRecordable) + SetUserUsageDetails(value []CostManagementUserUsageDetailable) + SetUserUsageRecords(value []CostManagementUserUsageRecordable) +} diff --git a/models/cost_management_user_usage_detail.go b/models/cost_management_user_usage_detail.go new file mode 100644 index 00000000000..1506c0dc68f --- /dev/null +++ b/models/cost_management_user_usage_detail.go @@ -0,0 +1,401 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// CostManagementUserUsageDetail one user's raw usage detail, distinct from the processed report at userUsageRecords. +type CostManagementUserUsageDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCostManagementUserUsageDetail instantiates a new CostManagementUserUsageDetail and sets the default values. +func NewCostManagementUserUsageDetail() *CostManagementUserUsageDetail { + m := &CostManagementUserUsageDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCostManagementUserUsageDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementUserUsageDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementUserUsageDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CostManagementUserUsageDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CostManagementUserUsageDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetConsumedQuantity gets the consumedQuantity property value. Raw, billable-flagged consumption attributed to this user over the requested window, boundedto the latest processed watermark rather than reprocessed. Read-only. +// returns a *float64 when successful +func (m *CostManagementUserUsageDetail) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetDataStatus gets the dataStatus property value. Freshness of the source activity data this detail was computed from, when the native sourcereports an as-of timestamp for the window. Null rather than fabricated when the source hasnone to report. Read-only. +// returns a CostManagementUsageDataStatusable when successful +func (m *CostManagementUserUsageDetail) GetDataStatus() CostManagementUsageDataStatusable { + val, err := m.GetBackingStore().Get("dataStatus") + if err != nil { + panic(err) + } + if val != nil { + return val.(CostManagementUsageDataStatusable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementUserUsageDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["dataStatus"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCostManagementUsageDataStatusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDataStatus(val.(CostManagementUsageDataStatusable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["services"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementUserUsageServiceDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementUserUsageServiceDetailable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementUserUsageServiceDetailable) + } + } + m.SetServices(res) + } + return nil + } + res["sessionCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetSessionCount(val) + } + return nil + } + res["sessions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCostManagementUserUsageSessionDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CostManagementUserUsageSessionDetailable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CostManagementUserUsageSessionDetailable) + } + } + m.SetSessions(res) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + res["userId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserId(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CostManagementUserUsageDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetServices gets the services property value. This user's raw consumption, split by governed service. The same native grouped result isalso addressable directly at the services navigation collection. +// returns a []CostManagementUserUsageServiceDetailable when successful +func (m *CostManagementUserUsageDetail) GetServices() []CostManagementUserUsageServiceDetailable { + val, err := m.GetBackingStore().Get("services") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementUserUsageServiceDetailable) + } + return nil +} + +// GetSessionCount gets the sessionCount property value. Count of billable-flagged activity sessions, bounded to the latest processed watermark, thatcontributed to consumedQuantity. Excludes non-billable activity; the timestamp window and rawsource distinguish this count from the processed completed-day report. Read-only. +// returns a *int64 when successful +func (m *CostManagementUserUsageDetail) GetSessionCount() *int64 { + val, err := m.GetBackingStore().Get("sessionCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int64) + } + return nil +} + +// GetSessions gets the sessions property value. This user's raw usage grouped by session identifiers represented by the native source.Activity without a session identifier may be omitted even when included in the parent total;child quantities need not sum to the parent's consumedQuantity. Also available as a direct collection. +// returns a []CostManagementUserUsageSessionDetailable when successful +func (m *CostManagementUserUsageDetail) GetSessions() []CostManagementUserUsageSessionDetailable { + val, err := m.GetBackingStore().Get("sessions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]CostManagementUserUsageSessionDetailable) + } + return nil +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementUserUsageDetail) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// GetUserId gets the userId property value. The identifier of the user this detail covers. Read-only. +// returns a *string when successful +func (m *CostManagementUserUsageDetail) GetUserId() *string { + val, err := m.GetBackingStore().Get("userId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementUserUsageDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetServices() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetServices())) + for i, v := range m.GetServices() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("services", cast) + if err != nil { + return err + } + } + if m.GetSessions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSessions())) + for i, v := range m.GetSessions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("sessions", cast) + if err != nil { + return err + } + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err := writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CostManagementUserUsageDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CostManagementUserUsageDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetConsumedQuantity sets the consumedQuantity property value. Raw, billable-flagged consumption attributed to this user over the requested window, boundedto the latest processed watermark rather than reprocessed. Read-only. +func (m *CostManagementUserUsageDetail) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetDataStatus sets the dataStatus property value. Freshness of the source activity data this detail was computed from, when the native sourcereports an as-of timestamp for the window. Null rather than fabricated when the source hasnone to report. Read-only. +func (m *CostManagementUserUsageDetail) SetDataStatus(value CostManagementUsageDataStatusable) { + err := m.GetBackingStore().Set("dataStatus", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CostManagementUserUsageDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetServices sets the services property value. This user's raw consumption, split by governed service. The same native grouped result isalso addressable directly at the services navigation collection. +func (m *CostManagementUserUsageDetail) SetServices(value []CostManagementUserUsageServiceDetailable) { + err := m.GetBackingStore().Set("services", value) + if err != nil { + panic(err) + } +} + +// SetSessionCount sets the sessionCount property value. Count of billable-flagged activity sessions, bounded to the latest processed watermark, thatcontributed to consumedQuantity. Excludes non-billable activity; the timestamp window and rawsource distinguish this count from the processed completed-day report. Read-only. +func (m *CostManagementUserUsageDetail) SetSessionCount(value *int64) { + err := m.GetBackingStore().Set("sessionCount", value) + if err != nil { + panic(err) + } +} + +// SetSessions sets the sessions property value. This user's raw usage grouped by session identifiers represented by the native source.Activity without a session identifier may be omitted even when included in the parent total;child quantities need not sum to the parent's consumedQuantity. Also available as a direct collection. +func (m *CostManagementUserUsageDetail) SetSessions(value []CostManagementUserUsageSessionDetailable) { + err := m.GetBackingStore().Set("sessions", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementUserUsageDetail) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +// SetUserId sets the userId property value. The identifier of the user this detail covers. Read-only. +func (m *CostManagementUserUsageDetail) SetUserId(value *string) { + err := m.GetBackingStore().Set("userId", value) + if err != nil { + panic(err) + } +} + +type CostManagementUserUsageDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetConsumedQuantity() *float64 + GetDataStatus() CostManagementUsageDataStatusable + GetOdataType() *string + GetServices() []CostManagementUserUsageServiceDetailable + GetSessionCount() *int64 + GetSessions() []CostManagementUserUsageSessionDetailable + GetUnit() *CostManagementUnit + GetUserId() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetConsumedQuantity(value *float64) + SetDataStatus(value CostManagementUsageDataStatusable) + SetOdataType(value *string) + SetServices(value []CostManagementUserUsageServiceDetailable) + SetSessionCount(value *int64) + SetSessions(value []CostManagementUserUsageSessionDetailable) + SetUnit(value *CostManagementUnit) + SetUserId(value *string) +} diff --git a/models/cost_management_user_usage_record.go b/models/cost_management_user_usage_record.go new file mode 100644 index 00000000000..45a2a890b79 --- /dev/null +++ b/models/cost_management_user_usage_record.go @@ -0,0 +1,266 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// CostManagementUserUsageRecord one user's reported consumption for one completed UTC day. +type CostManagementUserUsageRecord struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCostManagementUserUsageRecord instantiates a new CostManagementUserUsageRecord and sets the default values. +func NewCostManagementUserUsageRecord() *CostManagementUserUsageRecord { + m := &CostManagementUserUsageRecord{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCostManagementUserUsageRecordFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementUserUsageRecordFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementUserUsageRecord(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CostManagementUserUsageRecord) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CostManagementUserUsageRecord) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetConsumedQuantity gets the consumedQuantity property value. Billable consumption attributed to this user for the requested completed UTC day. Read-only. +// returns a *float64 when successful +func (m *CostManagementUserUsageRecord) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementUserUsageRecord) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["sessionCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetSessionCount(val) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + res["userId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserId(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CostManagementUserUsageRecord) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSessionCount gets the sessionCount property value. Count of distinct non-null session identifiers on billable activity for this user during therequested completed UTC day, subject to the source filters and plan processing watermarks.Excludes non-billable activity. Read-only. +// returns a *int64 when successful +func (m *CostManagementUserUsageRecord) GetSessionCount() *int64 { + val, err := m.GetBackingStore().Get("sessionCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int64) + } + return nil +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementUserUsageRecord) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// GetUserId gets the userId property value. The identifier of the user this row reports. Read-only. +// returns a *string when successful +func (m *CostManagementUserUsageRecord) GetUserId() *string { + val, err := m.GetBackingStore().Get("userId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementUserUsageRecord) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err := writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CostManagementUserUsageRecord) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CostManagementUserUsageRecord) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetConsumedQuantity sets the consumedQuantity property value. Billable consumption attributed to this user for the requested completed UTC day. Read-only. +func (m *CostManagementUserUsageRecord) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CostManagementUserUsageRecord) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetSessionCount sets the sessionCount property value. Count of distinct non-null session identifiers on billable activity for this user during therequested completed UTC day, subject to the source filters and plan processing watermarks.Excludes non-billable activity. Read-only. +func (m *CostManagementUserUsageRecord) SetSessionCount(value *int64) { + err := m.GetBackingStore().Set("sessionCount", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementUserUsageRecord) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +// SetUserId sets the userId property value. The identifier of the user this row reports. Read-only. +func (m *CostManagementUserUsageRecord) SetUserId(value *string) { + err := m.GetBackingStore().Set("userId", value) + if err != nil { + panic(err) + } +} + +type CostManagementUserUsageRecordable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetConsumedQuantity() *float64 + GetOdataType() *string + GetSessionCount() *int64 + GetUnit() *CostManagementUnit + GetUserId() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetConsumedQuantity(value *float64) + SetOdataType(value *string) + SetSessionCount(value *int64) + SetUnit(value *CostManagementUnit) + SetUserId(value *string) +} diff --git a/models/cost_management_user_usage_service_detail.go b/models/cost_management_user_usage_service_detail.go new file mode 100644 index 00000000000..fe8e84f4901 --- /dev/null +++ b/models/cost_management_user_usage_service_detail.go @@ -0,0 +1,121 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CostManagementUserUsageServiceDetail one governed service's share of a user's raw usage detail. +type CostManagementUserUsageServiceDetail struct { + Entity +} + +// NewCostManagementUserUsageServiceDetail instantiates a new CostManagementUserUsageServiceDetail and sets the default values. +func NewCostManagementUserUsageServiceDetail() *CostManagementUserUsageServiceDetail { + m := &CostManagementUserUsageServiceDetail{ + Entity: *NewEntity(), + } + return m +} + +// CreateCostManagementUserUsageServiceDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementUserUsageServiceDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementUserUsageServiceDetail(), nil +} + +// GetConsumedQuantity gets the consumedQuantity property value. Raw, billable-flagged consumption attributed to this service within the containing user'sdetail window. Independently rounded; child rows are not guaranteed to sum exactly to thecontaining detail's consumedQuantity. Read-only. +// returns a *float64 when successful +func (m *CostManagementUserUsageServiceDetail) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementUserUsageServiceDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + return res +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementUserUsageServiceDetail) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementUserUsageServiceDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err = writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetConsumedQuantity sets the consumedQuantity property value. Raw, billable-flagged consumption attributed to this service within the containing user'sdetail window. Independently rounded; child rows are not guaranteed to sum exactly to thecontaining detail's consumedQuantity. Read-only. +func (m *CostManagementUserUsageServiceDetail) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementUserUsageServiceDetail) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +type CostManagementUserUsageServiceDetailable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConsumedQuantity() *float64 + GetUnit() *CostManagementUnit + SetConsumedQuantity(value *float64) + SetUnit(value *CostManagementUnit) +} diff --git a/models/cost_management_user_usage_session_detail.go b/models/cost_management_user_usage_session_detail.go new file mode 100644 index 00000000000..10c7584f712 --- /dev/null +++ b/models/cost_management_user_usage_session_detail.go @@ -0,0 +1,221 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// CostManagementUserUsageSessionDetail a native-source session grouping within a user's raw usage detail. Activity without a sessionidentifier may be omitted, even when it contributes to the parent total. +type CostManagementUserUsageSessionDetail struct { + Entity +} + +// NewCostManagementUserUsageSessionDetail instantiates a new CostManagementUserUsageSessionDetail and sets the default values. +func NewCostManagementUserUsageSessionDetail() *CostManagementUserUsageSessionDetail { + m := &CostManagementUserUsageSessionDetail{ + Entity: *NewEntity(), + } + return m +} + +// CreateCostManagementUserUsageSessionDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCostManagementUserUsageSessionDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCostManagementUserUsageSessionDetail(), nil +} + +// GetConsumedQuantity gets the consumedQuantity property value. Raw, billable-flagged consumption attributed to this source-returned session grouping withinthe containing user's detail window. Session rows need not sum to the parent's consumedQuantity.Read-only. +// returns a *float64 when successful +func (m *CostManagementUserUsageSessionDetail) GetConsumedQuantity() *float64 { + val, err := m.GetBackingStore().Get("consumedQuantity") + if err != nil { + panic(err) + } + if val != nil { + return val.(*float64) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CostManagementUserUsageSessionDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["consumedQuantity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetConsumedQuantity(val) + } + return nil + } + res["firstActivityDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFirstActivityDateTime(val) + } + return nil + } + res["lastActivityDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastActivityDateTime(val) + } + return nil + } + res["sourceSessionId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceSessionId(val) + } + return nil + } + res["unit"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCostManagementUnit) + if err != nil { + return err + } + if val != nil { + m.SetUnit(val.(*CostManagementUnit)) + } + return nil + } + return res +} + +// GetFirstActivityDateTime gets the firstActivityDateTime property value. Time the earliest activity in this session was recorded, or null when the source did notreport one. Read-only. +// returns a *Time when successful +func (m *CostManagementUserUsageSessionDetail) GetFirstActivityDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("firstActivityDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetLastActivityDateTime gets the lastActivityDateTime property value. Time the latest activity in this session was recorded, or null when the source did notreport one. Read-only. +// returns a *Time when successful +func (m *CostManagementUserUsageSessionDetail) GetLastActivityDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastActivityDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetSourceSessionId gets the sourceSessionId property value. The native session identifier on a row returned by the source, preserved verbatim, includingnull if the source returns it. Distinct from this row's opaque id. A nullable value does notguarantee a returned group for activity without a session identifier; such activity may beabsent from the session breakdown while contributing to the parent total. Read-only. +// returns a *string when successful +func (m *CostManagementUserUsageSessionDetail) GetSourceSessionId() *string { + val, err := m.GetBackingStore().Get("sourceSessionId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUnit gets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +// returns a *CostManagementUnit when successful +func (m *CostManagementUserUsageSessionDetail) GetUnit() *CostManagementUnit { + val, err := m.GetBackingStore().Get("unit") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CostManagementUnit) + } + return nil +} + +// Serialize serializes information the current object +func (m *CostManagementUserUsageSessionDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetUnit() != nil { + cast := (*m.GetUnit()).String() + err = writer.WriteStringValue("unit", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetConsumedQuantity sets the consumedQuantity property value. Raw, billable-flagged consumption attributed to this source-returned session grouping withinthe containing user's detail window. Session rows need not sum to the parent's consumedQuantity.Read-only. +func (m *CostManagementUserUsageSessionDetail) SetConsumedQuantity(value *float64) { + err := m.GetBackingStore().Set("consumedQuantity", value) + if err != nil { + panic(err) + } +} + +// SetFirstActivityDateTime sets the firstActivityDateTime property value. Time the earliest activity in this session was recorded, or null when the source did notreport one. Read-only. +func (m *CostManagementUserUsageSessionDetail) SetFirstActivityDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("firstActivityDateTime", value) + if err != nil { + panic(err) + } +} + +// SetLastActivityDateTime sets the lastActivityDateTime property value. Time the latest activity in this session was recorded, or null when the source did notreport one. Read-only. +func (m *CostManagementUserUsageSessionDetail) SetLastActivityDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastActivityDateTime", value) + if err != nil { + panic(err) + } +} + +// SetSourceSessionId sets the sourceSessionId property value. The native session identifier on a row returned by the source, preserved verbatim, includingnull if the source returns it. Distinct from this row's opaque id. A nullable value does notguarantee a returned group for activity without a session identifier; such activity may beabsent from the session breakdown while contributing to the parent total. Read-only. +func (m *CostManagementUserUsageSessionDetail) SetSourceSessionId(value *string) { + err := m.GetBackingStore().Set("sourceSessionId", value) + if err != nil { + panic(err) + } +} + +// SetUnit sets the unit property value. Unit in which consumption quantities are expressed. Values are consumption units, not currency. +func (m *CostManagementUserUsageSessionDetail) SetUnit(value *CostManagementUnit) { + err := m.GetBackingStore().Set("unit", value) + if err != nil { + panic(err) + } +} + +type CostManagementUserUsageSessionDetailable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConsumedQuantity() *float64 + GetFirstActivityDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetLastActivityDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetSourceSessionId() *string + GetUnit() *CostManagementUnit + SetConsumedQuantity(value *float64) + SetFirstActivityDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastActivityDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetSourceSessionId(value *string) + SetUnit(value *CostManagementUnit) +} diff --git a/models/credential_provenance.go b/models/credential_provenance.go new file mode 100644 index 00000000000..ebb3aa81f44 --- /dev/null +++ b/models/credential_provenance.go @@ -0,0 +1,289 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type CredentialProvenance struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewCredentialProvenance instantiates a new CredentialProvenance and sets the default values. +func NewCredentialProvenance() *CredentialProvenance { + m := &CredentialProvenance{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateCredentialProvenanceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCredentialProvenanceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCredentialProvenance(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CredentialProvenance) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAssertedBy gets the assertedBy property value. Identifies the actor that established the provenance. This property is computed by the service. +// returns a ProvenanceAssertedByable when successful +func (m *CredentialProvenance) GetAssertedBy() ProvenanceAssertedByable { + val, err := m.GetBackingStore().Get("assertedBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(ProvenanceAssertedByable) + } + return nil +} + +// GetAssertions gets the assertions property value. The assertions that support the credential's provenance classification. +// returns a []ProvenanceAssertionable when successful +func (m *CredentialProvenance) GetAssertions() []ProvenanceAssertionable { + val, err := m.GetBackingStore().Get("assertions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ProvenanceAssertionable) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *CredentialProvenance) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetChainStatus gets the chainStatus property value. The current integrity status of the credential's chain of trust. +// returns a ProvenanceChainStatusable when successful +func (m *CredentialProvenance) GetChainStatus() ProvenanceChainStatusable { + val, err := m.GetBackingStore().Get("chainStatus") + if err != nil { + panic(err) + } + if val != nil { + return val.(ProvenanceChainStatusable) + } + return nil +} + +// GetClassification gets the classification property value. The classification property +// returns a *ProvenanceClassification when successful +func (m *CredentialProvenance) GetClassification() *ProvenanceClassification { + val, err := m.GetBackingStore().Get("classification") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ProvenanceClassification) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CredentialProvenance) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["assertedBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProvenanceAssertedByFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssertedBy(val.(ProvenanceAssertedByable)) + } + return nil + } + res["assertions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateProvenanceAssertionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ProvenanceAssertionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ProvenanceAssertionable) + } + } + m.SetAssertions(res) + } + return nil + } + res["chainStatus"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProvenanceChainStatusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetChainStatus(val.(ProvenanceChainStatusable)) + } + return nil + } + res["classification"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseProvenanceClassification) + if err != nil { + return err + } + if val != nil { + m.SetClassification(val.(*ProvenanceClassification)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *CredentialProvenance) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *CredentialProvenance) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetAssertions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssertions())) + for i, v := range m.GetAssertions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assertions", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("chainStatus", m.GetChainStatus()) + if err != nil { + return err + } + } + if m.GetClassification() != nil { + cast := (*m.GetClassification()).String() + err := writer.WriteStringValue("classification", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CredentialProvenance) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAssertedBy sets the assertedBy property value. Identifies the actor that established the provenance. This property is computed by the service. +func (m *CredentialProvenance) SetAssertedBy(value ProvenanceAssertedByable) { + err := m.GetBackingStore().Set("assertedBy", value) + if err != nil { + panic(err) + } +} + +// SetAssertions sets the assertions property value. The assertions that support the credential's provenance classification. +func (m *CredentialProvenance) SetAssertions(value []ProvenanceAssertionable) { + err := m.GetBackingStore().Set("assertions", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *CredentialProvenance) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetChainStatus sets the chainStatus property value. The current integrity status of the credential's chain of trust. +func (m *CredentialProvenance) SetChainStatus(value ProvenanceChainStatusable) { + err := m.GetBackingStore().Set("chainStatus", value) + if err != nil { + panic(err) + } +} + +// SetClassification sets the classification property value. The classification property +func (m *CredentialProvenance) SetClassification(value *ProvenanceClassification) { + err := m.GetBackingStore().Set("classification", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *CredentialProvenance) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type CredentialProvenanceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssertedBy() ProvenanceAssertedByable + GetAssertions() []ProvenanceAssertionable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetChainStatus() ProvenanceChainStatusable + GetClassification() *ProvenanceClassification + GetOdataType() *string + SetAssertedBy(value ProvenanceAssertedByable) + SetAssertions(value []ProvenanceAssertionable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetChainStatus(value ProvenanceChainStatusable) + SetClassification(value *ProvenanceClassification) + SetOdataType(value *string) +} diff --git a/models/credit_request.go b/models/credit_request.go new file mode 100644 index 00000000000..868581e119b --- /dev/null +++ b/models/credit_request.go @@ -0,0 +1,333 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// CreditRequest a credit request submitted by a user and acted on by an administrator.Derives from entity; the client-visible identifier is id.ETag-based optimistic concurrency is enforced via the standard OData ETag mechanism.Individual PATCH uses If-Match; the bulk action uses each item's etag field. +type CreditRequest struct { + Entity +} + +// NewCreditRequest instantiates a new CreditRequest and sets the default values. +func NewCreditRequest() *CreditRequest { + m := &CreditRequest{ + Entity: *NewEntity(), + } + return m +} + +// CreateCreditRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCreditRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCreditRequest(), nil +} + +// GetCreatedDateTime gets the createdDateTime property value. The date and time the request was created. +// returns a *Time when successful +func (m *CreditRequest) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDecisionBy gets the decisionBy property value. The identity of the administrator who approved or rejected the request.Only the user facet is populated. Null until the request is decided. +// returns a IdentitySetable when successful +func (m *CreditRequest) GetDecisionBy() IdentitySetable { + val, err := m.GetBackingStore().Get("decisionBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdentitySetable) + } + return nil +} + +// GetExpirationDateTime gets the expirationDateTime property value. The date and time the request expires. The backing service sets this to 90 days aftercreation and resets it to 90 days after a state-changing update. +// returns a *Time when successful +func (m *CreditRequest) GetExpirationDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("expirationDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *CreditRequest) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["decisionBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdentitySetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDecisionBy(val.(IdentitySetable)) + } + return nil + } + res["expirationDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpirationDateTime(val) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["requestedBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdentitySetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedBy(val.(IdentitySetable)) + } + return nil + } + res["requestType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCreditRequestType) + if err != nil { + return err + } + if val != nil { + m.SetRequestType(val.(*CreditRequestType)) + } + return nil + } + res["serviceId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServiceId(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCreditRequestState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CreditRequestState)) + } + return nil + } + return res +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The date and time the request was last modified. +// returns a *Time when successful +func (m *CreditRequest) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetRequestedBy gets the requestedBy property value. The requestedBy property +// returns a IdentitySetable when successful +func (m *CreditRequest) GetRequestedBy() IdentitySetable { + val, err := m.GetBackingStore().Get("requestedBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdentitySetable) + } + return nil +} + +// GetRequestType gets the requestType property value. The reason or trigger that caused a credit request to be created. +// returns a *CreditRequestType when successful +func (m *CreditRequest) GetRequestType() *CreditRequestType { + val, err := m.GetBackingStore().Get("requestType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CreditRequestType) + } + return nil +} + +// GetServiceId gets the serviceId property value. The open, extensible service identifier associated with this credit request,using the same values as other Copilot Cost Management APIs, such as cowork and workIQ. +// returns a *string when successful +func (m *CreditRequest) GetServiceId() *string { + val, err := m.GetBackingStore().Get("serviceId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetState gets the state property value. The state of a credit request in the approval workflow. +// returns a *CreditRequestState when successful +func (m *CreditRequest) GetState() *CreditRequestState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*CreditRequestState) + } + return nil +} + +// Serialize serializes information the current object +func (m *CreditRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("requestedBy", m.GetRequestedBy()) + if err != nil { + return err + } + } + if m.GetRequestType() != nil { + cast := (*m.GetRequestType()).String() + err = writer.WriteStringValue("requestType", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err = writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetCreatedDateTime sets the createdDateTime property value. The date and time the request was created. +func (m *CreditRequest) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDecisionBy sets the decisionBy property value. The identity of the administrator who approved or rejected the request.Only the user facet is populated. Null until the request is decided. +func (m *CreditRequest) SetDecisionBy(value IdentitySetable) { + err := m.GetBackingStore().Set("decisionBy", value) + if err != nil { + panic(err) + } +} + +// SetExpirationDateTime sets the expirationDateTime property value. The date and time the request expires. The backing service sets this to 90 days aftercreation and resets it to 90 days after a state-changing update. +func (m *CreditRequest) SetExpirationDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("expirationDateTime", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The date and time the request was last modified. +func (m *CreditRequest) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetRequestedBy sets the requestedBy property value. The requestedBy property +func (m *CreditRequest) SetRequestedBy(value IdentitySetable) { + err := m.GetBackingStore().Set("requestedBy", value) + if err != nil { + panic(err) + } +} + +// SetRequestType sets the requestType property value. The reason or trigger that caused a credit request to be created. +func (m *CreditRequest) SetRequestType(value *CreditRequestType) { + err := m.GetBackingStore().Set("requestType", value) + if err != nil { + panic(err) + } +} + +// SetServiceId sets the serviceId property value. The open, extensible service identifier associated with this credit request,using the same values as other Copilot Cost Management APIs, such as cowork and workIQ. +func (m *CreditRequest) SetServiceId(value *string) { + err := m.GetBackingStore().Set("serviceId", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. The state of a credit request in the approval workflow. +func (m *CreditRequest) SetState(value *CreditRequestState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +type CreditRequestable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDecisionBy() IdentitySetable + GetExpirationDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetRequestedBy() IdentitySetable + GetRequestType() *CreditRequestType + GetServiceId() *string + GetState() *CreditRequestState + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDecisionBy(value IdentitySetable) + SetExpirationDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetRequestedBy(value IdentitySetable) + SetRequestType(value *CreditRequestType) + SetServiceId(value *string) + SetState(value *CreditRequestState) +} diff --git a/models/credit_request_state.go b/models/credit_request_state.go new file mode 100644 index 00000000000..6efdb3ed12f --- /dev/null +++ b/models/credit_request_state.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// The state of a credit request in the approval workflow. +type CreditRequestState int + +const ( + // The request is awaiting an administrator decision. + PENDING_CREDITREQUESTSTATE CreditRequestState = iota + // The request has been approved by an administrator. + APPROVED_CREDITREQUESTSTATE + // The request has been rejected by an administrator. + REJECTED_CREDITREQUESTSTATE + // The request was cancelled by the system or the requester. Read-only historical state. + CANCELLED_CREDITREQUESTSTATE + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_CREDITREQUESTSTATE +) + +func (i CreditRequestState) String() string { + return []string{"pending", "approved", "rejected", "cancelled", "unknownFutureValue"}[i] +} + +func ParseCreditRequestState(v string) (any, error) { + result := PENDING_CREDITREQUESTSTATE + switch v { + case "pending": + result = PENDING_CREDITREQUESTSTATE + case "approved": + result = APPROVED_CREDITREQUESTSTATE + case "rejected": + result = REJECTED_CREDITREQUESTSTATE + case "cancelled": + result = CANCELLED_CREDITREQUESTSTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CREDITREQUESTSTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeCreditRequestState(values []CreditRequestState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i CreditRequestState) isMultiValue() bool { + return false +} diff --git a/models/credit_request_type.go b/models/credit_request_type.go new file mode 100644 index 00000000000..d44313dbd3d --- /dev/null +++ b/models/credit_request_type.go @@ -0,0 +1,51 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// The reason or trigger that caused a credit request to be created. +type CreditRequestType int + +const ( + // The request type is not known. + UNKNOWN_CREDITREQUESTTYPE CreditRequestType = iota + // The requester has no credits and is requesting their first allocation. + FIRSTTIMEACCESS_CREDITREQUESTTYPE + // The requester has already used credits and needs more because they have run out or are about to. + ADDITIONALCREDITS_CREDITREQUESTTYPE + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_CREDITREQUESTTYPE +) + +func (i CreditRequestType) String() string { + return []string{"unknown", "firstTimeAccess", "additionalCredits", "unknownFutureValue"}[i] +} + +func ParseCreditRequestType(v string) (any, error) { + result := UNKNOWN_CREDITREQUESTTYPE + switch v { + case "unknown": + result = UNKNOWN_CREDITREQUESTTYPE + case "firstTimeAccess": + result = FIRSTTIMEACCESS_CREDITREQUESTTYPE + case "additionalCredits": + result = ADDITIONALCREDITS_CREDITREQUESTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_CREDITREQUESTTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeCreditRequestType(values []CreditRequestType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i CreditRequestType) isMultiValue() bool { + return false +} diff --git a/models/custom_field_definition.go b/models/custom_field_definition.go index 041ddc9f587..ddaa31cf303 100644 --- a/models/custom_field_definition.go +++ b/models/custom_field_definition.go @@ -78,7 +78,7 @@ func (m *CustomFieldDefinition) GetCreatedDateTime() *i336074805fc853987abe6f7fe return nil } -// GetDeletedBy gets the deletedBy property value. Identity of the user who deleted the custom field definition, if it was deleted. +// GetDeletedBy gets the deletedBy property value. Identity of the user who deleted the custom field definition, if it was deleted. Read-only. // returns a IdentitySetable when successful func (m *CustomFieldDefinition) GetDeletedBy() IdentitySetable { val, err := m.GetBackingStore().Get("deletedBy") @@ -91,7 +91,7 @@ func (m *CustomFieldDefinition) GetDeletedBy() IdentitySetable { return nil } -// GetDeletedDateTime gets the deletedDateTime property value. Date and time the custom field definition was deleted, if applicable. +// GetDeletedDateTime gets the deletedDateTime property value. Date and time the custom field definition was deleted, if applicable. Read-only. // returns a *Time when successful func (m *CustomFieldDefinition) GetDeletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { val, err := m.GetBackingStore().Get("deletedDateTime") @@ -302,7 +302,7 @@ func (m *CustomFieldDefinition) GetRollupType() *CustomFieldRollupType { return nil } -// GetValueType gets the valueType property value. Data type of the custom field's values.. The possible values are: text, date, utcDateTime, number, decimal, flag, singleChoiceText, multipleChoiceText, unknownFutureValue. +// GetValueType gets the valueType property value. Data type of the custom field's values. Immutable after creation. The possible values are: text, date, utcDateTime, number, decimal, flag, singleChoiceText, multipleChoiceText, unknownFutureValue. The values utcDateTime, decimal, and multipleChoiceText can occur on existing fields; they aren't supported types for new field definitions. // returns a *CustomFieldValueType when successful func (m *CustomFieldDefinition) GetValueType() *CustomFieldValueType { val, err := m.GetBackingStore().Get("valueType") @@ -412,7 +412,7 @@ func (m *CustomFieldDefinition) SetCreatedDateTime(value *i336074805fc853987abe6 } } -// SetDeletedBy sets the deletedBy property value. Identity of the user who deleted the custom field definition, if it was deleted. +// SetDeletedBy sets the deletedBy property value. Identity of the user who deleted the custom field definition, if it was deleted. Read-only. func (m *CustomFieldDefinition) SetDeletedBy(value IdentitySetable) { err := m.GetBackingStore().Set("deletedBy", value) if err != nil { @@ -420,7 +420,7 @@ func (m *CustomFieldDefinition) SetDeletedBy(value IdentitySetable) { } } -// SetDeletedDateTime sets the deletedDateTime property value. Date and time the custom field definition was deleted, if applicable. +// SetDeletedDateTime sets the deletedDateTime property value. Date and time the custom field definition was deleted, if applicable. Read-only. func (m *CustomFieldDefinition) SetDeletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { err := m.GetBackingStore().Set("deletedDateTime", value) if err != nil { @@ -468,7 +468,7 @@ func (m *CustomFieldDefinition) SetRollupType(value *CustomFieldRollupType) { } } -// SetValueType sets the valueType property value. Data type of the custom field's values.. The possible values are: text, date, utcDateTime, number, decimal, flag, singleChoiceText, multipleChoiceText, unknownFutureValue. +// SetValueType sets the valueType property value. Data type of the custom field's values. Immutable after creation. The possible values are: text, date, utcDateTime, number, decimal, flag, singleChoiceText, multipleChoiceText, unknownFutureValue. The values utcDateTime, decimal, and multipleChoiceText can occur on existing fields; they aren't supported types for new field definitions. func (m *CustomFieldDefinition) SetValueType(value *CustomFieldValueType) { err := m.GetBackingStore().Set("valueType", value) if err != nil { diff --git a/models/date_with_optional_time.go b/models/date_with_optional_time.go index 280b28cb635..420ff3105c0 100644 --- a/models/date_with_optional_time.go +++ b/models/date_with_optional_time.go @@ -117,7 +117,7 @@ func (m *DateWithOptionalTime) GetFieldDeserializers() map[string]func(i878a80d2 return res } -// GetIsTimeSpecified gets the isTimeSpecified property value. Indicates whether a specific time (not just a date) was provided. +// GetIsTimeSpecified gets the isTimeSpecified property value. Indicates whether a specific time (not just a date) was provided. Read-only. // returns a *bool when successful func (m *DateWithOptionalTime) GetIsTimeSpecified() *bool { val, err := m.GetBackingStore().Get("isTimeSpecified") @@ -143,7 +143,7 @@ func (m *DateWithOptionalTime) GetOdataType() *string { return nil } -// GetTime gets the time property value. The optional time-of-day component of the value. +// GetTime gets the time property value. The optional time-of-day component of the value. Read-only. // returns a *TimeOnly when successful func (m *DateWithOptionalTime) GetTime() *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.TimeOnly { val, err := m.GetBackingStore().Get("time") @@ -156,7 +156,7 @@ func (m *DateWithOptionalTime) GetTime() *i878a80d2330e89d26896388a3f487eef27b0a return nil } -// GetTimeZone gets the timeZone property value. Time zone the time value is expressed in, if time is set. +// GetTimeZone gets the timeZone property value. Time zone the time value is expressed in, if time is set. Read-only. // returns a *string when successful func (m *DateWithOptionalTime) GetTimeZone() *string { val, err := m.GetBackingStore().Get("timeZone") @@ -231,7 +231,7 @@ func (m *DateWithOptionalTime) SetDate(value *i878a80d2330e89d26896388a3f487eef2 } } -// SetIsTimeSpecified sets the isTimeSpecified property value. Indicates whether a specific time (not just a date) was provided. +// SetIsTimeSpecified sets the isTimeSpecified property value. Indicates whether a specific time (not just a date) was provided. Read-only. func (m *DateWithOptionalTime) SetIsTimeSpecified(value *bool) { err := m.GetBackingStore().Set("isTimeSpecified", value) if err != nil { @@ -247,7 +247,7 @@ func (m *DateWithOptionalTime) SetOdataType(value *string) { } } -// SetTime sets the time property value. The optional time-of-day component of the value. +// SetTime sets the time property value. The optional time-of-day component of the value. Read-only. func (m *DateWithOptionalTime) SetTime(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.TimeOnly) { err := m.GetBackingStore().Set("time", value) if err != nil { @@ -255,7 +255,7 @@ func (m *DateWithOptionalTime) SetTime(value *i878a80d2330e89d26896388a3f487eef2 } } -// SetTimeZone sets the timeZone property value. Time zone the time value is expressed in, if time is set. +// SetTimeZone sets the timeZone property value. Time zone the time value is expressed in, if time is set. Read-only. func (m *DateWithOptionalTime) SetTimeZone(value *string) { err := m.GetBackingStore().Set("timeZone", value) if err != nil { diff --git a/models/dependency.go b/models/dependency.go index 134a9bce2cc..be9d02f6812 100644 --- a/models/dependency.go +++ b/models/dependency.go @@ -191,7 +191,7 @@ func (m *Dependency) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a return nil } -// GetSourceItemId gets the sourceItemId property value. ID of the source item in the dependency. +// GetSourceItemId gets the sourceItemId property value. ID of the source item in the dependency. Immutable after creation. // returns a *string when successful func (m *Dependency) GetSourceItemId() *string { val, err := m.GetBackingStore().Get("sourceItemId") @@ -204,7 +204,7 @@ func (m *Dependency) GetSourceItemId() *string { return nil } -// GetTargetItemId gets the targetItemId property value. ID of the target item in the dependency. +// GetTargetItemId gets the targetItemId property value. ID of the target item in the dependency. Immutable after creation. // returns a *string when successful func (m *Dependency) GetTargetItemId() *string { val, err := m.GetBackingStore().Get("targetItemId") @@ -317,7 +317,7 @@ func (m *Dependency) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3a } } -// SetSourceItemId sets the sourceItemId property value. ID of the source item in the dependency. +// SetSourceItemId sets the sourceItemId property value. ID of the source item in the dependency. Immutable after creation. func (m *Dependency) SetSourceItemId(value *string) { err := m.GetBackingStore().Set("sourceItemId", value) if err != nil { @@ -325,7 +325,7 @@ func (m *Dependency) SetSourceItemId(value *string) { } } -// SetTargetItemId sets the targetItemId property value. ID of the target item in the dependency. +// SetTargetItemId sets the targetItemId property value. ID of the target item in the dependency. Immutable after creation. func (m *Dependency) SetTargetItemId(value *string) { err := m.GetBackingStore().Set("targetItemId", value) if err != nil { diff --git a/models/device_management_configuration_windows_skus.go b/models/device_management_configuration_windows_skus.go index 2b584db7e57..2c6f560c51f 100644 --- a/models/device_management_configuration_windows_skus.go +++ b/models/device_management_configuration_windows_skus.go @@ -36,10 +36,16 @@ const ( WINDOWSMULTISESSION_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS // Indicates the Device Management Configuration Windows SKU is 'surfaceHub' SURFACEHUB_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS + // Indicates that the setting is applicable to the Windows CPC SKU family. Existing public beta member. + WINDOWSCPC_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS + // Evolvable enumeration sentinel value. Do not use. + UNKNOWNFUTUREVALUE_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS + // Indicates that the setting is applicable to the Windows Server SKU family. Use the Prefer: include-unknown-enum-members request header to receive this value. + WINDOWSSERVER_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS ) func (i DeviceManagementConfigurationWindowsSkus) String() string { - return []string{"unknown", "windowsHome", "windowsProfessional", "windowsEnterprise", "windowsEducation", "windowsMobile", "windowsMobileEnterprise", "windowsTeamSurface", "iot", "iotEnterprise", "holoLens", "holoLensEnterprise", "holographicForBusiness", "windowsMultiSession", "surfaceHub"}[i] + return []string{"unknown", "windowsHome", "windowsProfessional", "windowsEnterprise", "windowsEducation", "windowsMobile", "windowsMobileEnterprise", "windowsTeamSurface", "iot", "iotEnterprise", "holoLens", "holoLensEnterprise", "holographicForBusiness", "windowsMultiSession", "surfaceHub", "windowsCPC", "unknownFutureValue", "windowsServer"}[i] } func ParseDeviceManagementConfigurationWindowsSkus(v string) (any, error) { @@ -75,6 +81,12 @@ func ParseDeviceManagementConfigurationWindowsSkus(v string) (any, error) { result = WINDOWSMULTISESSION_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS case "surfaceHub": result = SURFACEHUB_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS + case "windowsCPC": + result = WINDOWSCPC_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS + case "windowsServer": + result = WINDOWSSERVER_DEVICEMANAGEMENTCONFIGURATIONWINDOWSSKUS default: return nil, nil } diff --git a/models/devicemanagement/alert_record.go b/models/devicemanagement/alert_record.go index ab1b043f9ef..4758a09970d 100644 --- a/models/devicemanagement/alert_record.go +++ b/models/devicemanagement/alert_record.go @@ -53,7 +53,7 @@ func (m *AlertRecord) GetAlertRuleId() *string { return nil } -// GetAlertRuleTemplate gets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. +// GetAlertRuleTemplate gets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. // returns a *AlertRuleTemplate when successful func (m *AlertRecord) GetAlertRuleTemplate() *AlertRuleTemplate { val, err := m.GetBackingStore().Get("alertRuleTemplate") @@ -323,7 +323,7 @@ func (m *AlertRecord) SetAlertRuleId(value *string) { } } -// SetAlertRuleTemplate sets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. +// SetAlertRuleTemplate sets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. func (m *AlertRecord) SetAlertRuleTemplate(value *AlertRuleTemplate) { err := m.GetBackingStore().Set("alertRuleTemplate", value) if err != nil { diff --git a/models/devicemanagement/alert_rule.go b/models/devicemanagement/alert_rule.go index c8efab01a5a..d5aaa37225d 100644 --- a/models/devicemanagement/alert_rule.go +++ b/models/devicemanagement/alert_rule.go @@ -26,7 +26,7 @@ func CreateAlertRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f return NewAlertRule(), nil } -// GetAlertRuleTemplate gets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. +// GetAlertRuleTemplate gets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. // returns a *AlertRuleTemplate when successful func (m *AlertRule) GetAlertRuleTemplate() *AlertRuleTemplate { val, err := m.GetBackingStore().Get("alertRuleTemplate") @@ -329,7 +329,7 @@ func (m *AlertRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c0 return nil } -// SetAlertRuleTemplate sets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario. +// SetAlertRuleTemplate sets the alertRuleTemplate property value. The rule template of the alert event. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. func (m *AlertRule) SetAlertRuleTemplate(value *AlertRuleTemplate) { err := m.GetBackingStore().Set("alertRuleTemplate", value) if err != nil { diff --git a/models/devicemanagement/alert_rule_template.go b/models/devicemanagement/alert_rule_template.go index aa8bcbb2a77..0d6ac5f6a32 100644 --- a/models/devicemanagement/alert_rule_template.go +++ b/models/devicemanagement/alert_rule_template.go @@ -16,10 +16,11 @@ const ( CLOUDPCFRONTLINECONCURRENCYSCENARIO_ALERTRULETEMPLATE CLOUDPCUSERSETTINGSPERSISTENCESCENARIO_ALERTRULETEMPLATE CLOUDPCDEPROVISIONFAILEDSCENARIO_ALERTRULETEMPLATE + CLOUDPCRESERVEHEALTHSCENARIO_ALERTRULETEMPLATE ) func (i AlertRuleTemplate) String() string { - return []string{"cloudPcProvisionScenario", "cloudPcImageUploadScenario", "cloudPcOnPremiseNetworkConnectionCheckScenario", "unknownFutureValue", "cloudPcInGracePeriodScenario", "cloudPcFrontlineInsufficientLicensesScenario", "cloudPcInaccessibleScenario", "cloudPcFrontlineConcurrencyScenario", "cloudPcUserSettingsPersistenceScenario", "cloudPcDeprovisionFailedScenario"}[i] + return []string{"cloudPcProvisionScenario", "cloudPcImageUploadScenario", "cloudPcOnPremiseNetworkConnectionCheckScenario", "unknownFutureValue", "cloudPcInGracePeriodScenario", "cloudPcFrontlineInsufficientLicensesScenario", "cloudPcInaccessibleScenario", "cloudPcFrontlineConcurrencyScenario", "cloudPcUserSettingsPersistenceScenario", "cloudPcDeprovisionFailedScenario", "cloudPcReserveHealthScenario"}[i] } func ParseAlertRuleTemplate(v string) (any, error) { @@ -45,6 +46,8 @@ func ParseAlertRuleTemplate(v string) (any, error) { result = CLOUDPCUSERSETTINGSPERSISTENCESCENARIO_ALERTRULETEMPLATE case "cloudPcDeprovisionFailedScenario": result = CLOUDPCDEPROVISIONFAILEDSCENARIO_ALERTRULETEMPLATE + case "cloudPcReserveHealthScenario": + result = CLOUDPCRESERVEHEALTHSCENARIO_ALERTRULETEMPLATE default: return nil, nil } diff --git a/models/devicemanagement/condition_category.go b/models/devicemanagement/condition_category.go index 3c9dad8d816..f9621214f86 100644 --- a/models/devicemanagement/condition_category.go +++ b/models/devicemanagement/condition_category.go @@ -20,10 +20,13 @@ const ( CLOUDPCUSERSETTINGSPERSISTENCEUSAGETHRESHOLD_CONDITIONCATEGORY CLOUDPCDEPROVISIONEDTHRESHOLD_CONDITIONCATEGORY CLOUDPCRESERVEDEPROVISIONFAILEDTHRESHOLD_CONDITIONCATEGORY + CLOUDPCRESERVELICENSESAVAILABILITYBELOWTHRESHOLD_CONDITIONCATEGORY + RESERVECLOUDPCUNLICENSEDUSERSASSIGNMENT_CONDITIONCATEGORY + CLOUDPCMAXUSERSTORAGEUSAGETHRESHOLDEXCEEDED_CONDITIONCATEGORY ) func (i ConditionCategory) String() string { - return []string{"provisionFailures", "imageUploadFailures", "azureNetworkConnectionCheckFailures", "cloudPcInGracePeriod", "frontlineInsufficientLicenses", "cloudPcConnectionErrors", "cloudPcHostHealthCheckFailures", "cloudPcZoneOutage", "unknownFutureValue", "frontlineBufferUsageDuration", "frontlineBufferUsageThreshold", "cloudPcUserSettingsPersistenceUsageThreshold", "cloudPcDeprovisionedThreshold", "cloudPcReserveDeprovisionFailedThreshold"}[i] + return []string{"provisionFailures", "imageUploadFailures", "azureNetworkConnectionCheckFailures", "cloudPcInGracePeriod", "frontlineInsufficientLicenses", "cloudPcConnectionErrors", "cloudPcHostHealthCheckFailures", "cloudPcZoneOutage", "unknownFutureValue", "frontlineBufferUsageDuration", "frontlineBufferUsageThreshold", "cloudPcUserSettingsPersistenceUsageThreshold", "cloudPcDeprovisionedThreshold", "cloudPcReserveDeprovisionFailedThreshold", "cloudPcReserveLicensesAvailabilityBelowThreshold", "reserveCloudPcUnlicensedUsersAssignment", "cloudPcMaxUserStorageUsageThresholdExceeded"}[i] } func ParseConditionCategory(v string) (any, error) { @@ -57,6 +60,12 @@ func ParseConditionCategory(v string) (any, error) { result = CLOUDPCDEPROVISIONEDTHRESHOLD_CONDITIONCATEGORY case "cloudPcReserveDeprovisionFailedThreshold": result = CLOUDPCRESERVEDEPROVISIONFAILEDTHRESHOLD_CONDITIONCATEGORY + case "cloudPcReserveLicensesAvailabilityBelowThreshold": + result = CLOUDPCRESERVELICENSESAVAILABILITYBELOWTHRESHOLD_CONDITIONCATEGORY + case "reserveCloudPcUnlicensedUsersAssignment": + result = RESERVECLOUDPCUNLICENSEDUSERSASSIGNMENT_CONDITIONCATEGORY + case "cloudPcMaxUserStorageUsageThresholdExceeded": + result = CLOUDPCMAXUSERSTORAGEUSAGETHRESHOLDEXCEEDED_CONDITIONCATEGORY default: return nil, nil } diff --git a/models/devicemanagement/portal_notification.go b/models/devicemanagement/portal_notification.go index 57b01fcef88..b1d602e321c 100644 --- a/models/devicemanagement/portal_notification.go +++ b/models/devicemanagement/portal_notification.go @@ -93,7 +93,7 @@ func (m *PortalNotification) GetAlertRuleName() *string { return nil } -// GetAlertRuleTemplate gets the alertRuleTemplate property value. The associated alert rule template. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario. +// GetAlertRuleTemplate gets the alertRuleTemplate property value. The associated alert rule template. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. // returns a *AlertRuleTemplate when successful func (m *PortalNotification) GetAlertRuleTemplate() *AlertRuleTemplate { val, err := m.GetBackingStore().Get("alertRuleTemplate") @@ -368,7 +368,7 @@ func (m *PortalNotification) SetAlertRuleName(value *string) { } } -// SetAlertRuleTemplate sets the alertRuleTemplate property value. The associated alert rule template. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario. +// SetAlertRuleTemplate sets the alertRuleTemplate property value. The associated alert rule template. The possible values are: cloudPcProvisionScenario, cloudPcImageUploadScenario, cloudPcOnPremiseNetworkConnectionCheckScenario, unknownFutureValue, cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: cloudPcInGracePeriodScenario, cloudPcFrontlineInsufficientLicensesScenario, cloudPcInaccessibleScenario, cloudPcFrontlineConcurrencyScenario, cloudPcUserSettingsPersistenceScenario, cloudPcDeprovisionFailedScenario, cloudPcReserveHealthScenario. func (m *PortalNotification) SetAlertRuleTemplate(value *AlertRuleTemplate) { err := m.GetBackingStore().Set("alertRuleTemplate", value) if err != nil { diff --git a/models/devicemanagement/rule_condition.go b/models/devicemanagement/rule_condition.go index bee9988d940..3598ae855ba 100644 --- a/models/devicemanagement/rule_condition.go +++ b/models/devicemanagement/rule_condition.go @@ -60,7 +60,7 @@ func (m *RuleCondition) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d411854 return m.backingStore } -// GetConditionCategory gets the conditionCategory property value. The property that the rule condition monitors. The possible values are: provisionFailures, imageUploadFailures, azureNetworkConnectionCheckFailures, cloudPcInGracePeriod, frontlineInsufficientLicenses, cloudPcConnectionErrors, cloudPcHostHealthCheckFailures, cloudPcZoneOutage, unknownFutureValue, frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold. +// GetConditionCategory gets the conditionCategory property value. The property that the rule condition monitors. The possible values are: provisionFailures, imageUploadFailures, azureNetworkConnectionCheckFailures, cloudPcInGracePeriod, frontlineInsufficientLicenses, cloudPcConnectionErrors, cloudPcHostHealthCheckFailures, cloudPcZoneOutage, unknownFutureValue, frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold, cloudPcReserveLicensesAvailabilityBelowThreshold, reserveCloudPcUnlicensedUsersAssignment, cloudPcMaxUserStorageUsageThresholdExceeded. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold, cloudPcReserveLicensesAvailabilityBelowThreshold, reserveCloudPcUnlicensedUsersAssignment, cloudPcMaxUserStorageUsageThresholdExceeded. // returns a *ConditionCategory when successful func (m *RuleCondition) GetConditionCategory() *ConditionCategory { val, err := m.GetBackingStore().Get("conditionCategory") @@ -264,7 +264,7 @@ func (m *RuleCondition) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41 m.backingStore = value } -// SetConditionCategory sets the conditionCategory property value. The property that the rule condition monitors. The possible values are: provisionFailures, imageUploadFailures, azureNetworkConnectionCheckFailures, cloudPcInGracePeriod, frontlineInsufficientLicenses, cloudPcConnectionErrors, cloudPcHostHealthCheckFailures, cloudPcZoneOutage, unknownFutureValue, frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold. +// SetConditionCategory sets the conditionCategory property value. The property that the rule condition monitors. The possible values are: provisionFailures, imageUploadFailures, azureNetworkConnectionCheckFailures, cloudPcInGracePeriod, frontlineInsufficientLicenses, cloudPcConnectionErrors, cloudPcHostHealthCheckFailures, cloudPcZoneOutage, unknownFutureValue, frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold, cloudPcReserveLicensesAvailabilityBelowThreshold, reserveCloudPcUnlicensedUsersAssignment, cloudPcMaxUserStorageUsageThresholdExceeded. Use the Prefer: include-unknown-enum-members request header to get the following values from this evolvable enum: frontlineBufferUsageDuration, frontlineBufferUsageThreshold, cloudPcUserSettingsPersistenceUsageThreshold, cloudPcDeprovisionedThreshold, cloudPcReserveDeprovisionFailedThreshold, cloudPcReserveLicensesAvailabilityBelowThreshold, reserveCloudPcUnlicensedUsersAssignment, cloudPcMaxUserStorageUsageThresholdExceeded. func (m *RuleCondition) SetConditionCategory(value *ConditionCategory) { err := m.GetBackingStore().Set("conditionCategory", value) if err != nil { diff --git a/models/dynamic_permissions_management_root.go b/models/dynamic_permissions_management_root.go new file mode 100644 index 00000000000..b2dec81ac76 --- /dev/null +++ b/models/dynamic_permissions_management_root.go @@ -0,0 +1,47 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DynamicPermissionsManagementRoot struct { + Entity +} + +// NewDynamicPermissionsManagementRoot instantiates a new DynamicPermissionsManagementRoot and sets the default values. +func NewDynamicPermissionsManagementRoot() *DynamicPermissionsManagementRoot { + m := &DynamicPermissionsManagementRoot{ + Entity: *NewEntity(), + } + return m +} + +// CreateDynamicPermissionsManagementRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDynamicPermissionsManagementRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDynamicPermissionsManagementRoot(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *DynamicPermissionsManagementRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + return res +} + +// Serialize serializes information the current object +func (m *DynamicPermissionsManagementRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + return nil +} + +type DynamicPermissionsManagementRootable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/models/enforcement_mode.go b/models/enforcement_mode.go new file mode 100644 index 00000000000..5f2f00e6e55 --- /dev/null +++ b/models/enforcement_mode.go @@ -0,0 +1,43 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type EnforcementMode int + +const ( + DONOTENFORCE_ENFORCEMENTMODE EnforcementMode = iota + ENFORCE_ENFORCEMENTMODE + UNKNOWNFUTUREVALUE_ENFORCEMENTMODE +) + +func (i EnforcementMode) String() string { + return []string{"doNotEnforce", "enforce", "unknownFutureValue"}[i] +} + +func ParseEnforcementMode(v string) (any, error) { + result := DONOTENFORCE_ENFORCEMENTMODE + switch v { + case "doNotEnforce": + result = DONOTENFORCE_ENFORCEMENTMODE + case "enforce": + result = ENFORCE_ENFORCEMENTMODE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_ENFORCEMENTMODE + default: + return nil, nil + } + return &result, nil +} + +func SerializeEnforcementMode(values []EnforcementMode) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i EnforcementMode) isMultiValue() bool { + return false +} diff --git a/models/entity.go b/models/entity.go index 066a888fc25..05e42347e86 100644 --- a/models/entity.go +++ b/models/entity.go @@ -148,6 +148,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewAgentCollection(), nil case "#microsoft.graph.agentCommunicationConfiguration": return NewAgentCommunicationConfiguration(), nil + case "#microsoft.graph.agenticSecurityRoot": + return NewAgenticSecurityRoot(), nil case "#microsoft.graph.agentIdentity": return NewAgentIdentity(), nil case "#microsoft.graph.agentIdentityBlueprint": @@ -160,6 +162,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewAgentRegistration(), nil case "#microsoft.graph.agentRiskDetection": return NewAgentRiskDetection(), nil + case "#microsoft.graph.agentRun": + return NewAgentRun(), nil case "#microsoft.graph.agentUser": return NewAgentUser(), nil case "#microsoft.graph.agreement": @@ -786,6 +790,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewCloudPcBulkRestart(), nil case "#microsoft.graph.cloudPcBulkRestore": return NewCloudPcBulkRestore(), nil + case "#microsoft.graph.cloudPcBulkSetDeviceName": + return NewCloudPcBulkSetDeviceName(), nil case "#microsoft.graph.cloudPcBulkSetReviewStatus": return NewCloudPcBulkSetReviewStatus(), nil case "#microsoft.graph.cloudPcBulkTroubleshoot": @@ -858,6 +864,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewComplianceManagementPartner(), nil case "#microsoft.graph.conditionalAccessRoot": return NewConditionalAccessRoot(), nil + case "#microsoft.graph.conditionalAccessSettings": + return NewConditionalAccessSettings(), nil case "#microsoft.graph.conditionalAccessTemplate": return NewConditionalAccessTemplate(), nil case "#microsoft.graph.configManagerCollection": @@ -892,6 +900,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewContentActivity(), nil case "#microsoft.graph.contentLink": return NewContentLink(), nil + case "#microsoft.graph.contentManagementRoot": + return NewContentManagementRoot(), nil case "#microsoft.graph.contentModel": return NewContentModel(), nil case "#microsoft.graph.contentSharingSession": @@ -946,16 +956,26 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewCorsConfiguration_v2(), nil case "#microsoft.graph.costManagementAlertSetting": return NewCostManagementAlertSetting(), nil + case "#microsoft.graph.costManagementFundingUsageRecord": + return NewCostManagementFundingUsageRecord(), nil case "#microsoft.graph.costManagementRoot": return NewCostManagementRoot(), nil + case "#microsoft.graph.costManagementUsageReportRoot": + return NewCostManagementUsageReportRoot(), nil case "#microsoft.graph.costManagementUserBalance": return NewCostManagementUserBalance(), nil + case "#microsoft.graph.costManagementUserUsageServiceDetail": + return NewCostManagementUserUsageServiceDetail(), nil + case "#microsoft.graph.costManagementUserUsageSessionDetail": + return NewCostManagementUserUsageSessionDetail(), nil case "#microsoft.graph.credentialUsageSummary": return NewCredentialUsageSummary(), nil case "#microsoft.graph.credentialUserRegistrationCount": return NewCredentialUserRegistrationCount(), nil case "#microsoft.graph.credentialUserRegistrationDetails": return NewCredentialUserRegistrationDetails(), nil + case "#microsoft.graph.creditRequest": + return NewCreditRequest(), nil case "#microsoft.graph.crossTenantAccessPolicy": return NewCrossTenantAccessPolicy(), nil case "#microsoft.graph.crossTenantAccessPolicyConfigurationDefault": @@ -1396,6 +1416,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewDriveRestoreArtifact(), nil case "#microsoft.graph.driveRestoreArtifactsBulkAdditionRequest": return NewDriveRestoreArtifactsBulkAdditionRequest(), nil + case "#microsoft.graph.dynamicPermissionsManagementRoot": + return NewDynamicPermissionsManagementRoot(), nil case "#microsoft.graph.dynamicRuleActivityLog": return NewDynamicRuleActivityLog(), nil case "#microsoft.graph.easEmailProfileConfigurationBase": @@ -1826,6 +1848,10 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewIdentityUserFlowAttribute(), nil case "#microsoft.graph.identityUserFlowAttributeAssignment": return NewIdentityUserFlowAttributeAssignment(), nil + case "#microsoft.graph.identityVerificationEvent": + return NewIdentityVerificationEvent(), nil + case "#microsoft.graph.identityVerificationStatus": + return NewIdentityVerificationStatus(), nil case "#microsoft.graph.identityVerifiedIdRoot": return NewIdentityVerifiedIdRoot(), nil case "#microsoft.graph.impactedResource": @@ -1888,6 +1914,14 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewInvalidLicenseAlertConfiguration(), nil case "#microsoft.graph.invalidLicenseAlertIncident": return NewInvalidLicenseAlertIncident(), nil + case "#microsoft.graph.investigationInput": + return NewInvestigationInput(), nil + case "#microsoft.graph.investigationMessage": + return NewInvestigationMessage(), nil + case "#microsoft.graph.investigationOutput": + return NewInvestigationOutput(), nil + case "#microsoft.graph.investigationSession": + return NewInvestigationSession(), nil case "#microsoft.graph.invitation": return NewInvitation(), nil case "#microsoft.graph.inviteParticipantsOperation": @@ -2668,6 +2702,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewPlannerUser(), nil case "#microsoft.graph.platformCredentialAuthenticationMethod": return NewPlatformCredentialAuthenticationMethod(), nil + case "#microsoft.graph.playbookDefinition": + return NewPlaybookDefinition(), nil case "#microsoft.graph.playPromptOperation": return NewPlayPromptOperation(), nil case "#microsoft.graph.policyBase": @@ -2894,6 +2930,14 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewResourceAccountKeyAuthenticationMethod(), nil case "#microsoft.graph.resourceOperation": return NewResourceOperation(), nil + case "#microsoft.graph.resourcePolicyConfiguration": + return NewResourcePolicyConfiguration(), nil + case "#microsoft.graph.resourcePolicyDeletableRoot": + return NewResourcePolicyDeletableRoot(), nil + case "#microsoft.graph.resourcePolicyEvaluationEvent": + return NewResourcePolicyEvaluationEvent(), nil + case "#microsoft.graph.resourcePolicyRoot": + return NewResourcePolicyRoot(), nil case "#microsoft.graph.resourceSpecificPermissionGrant": return NewResourceSpecificPermissionGrant(), nil case "#microsoft.graph.restoreArtifactBase": @@ -3314,6 +3358,8 @@ func CreateEntityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487 return NewTeamwork(), nil case "#microsoft.graph.teamworkBot": return NewTeamworkBot(), nil + case "#microsoft.graph.teamworkChannelTag": + return NewTeamworkChannelTag(), nil case "#microsoft.graph.teamworkCustomEmoji": return NewTeamworkCustomEmoji(), nil case "#microsoft.graph.teamworkDevice": diff --git a/models/fetch_detail.go b/models/fetch_detail.go new file mode 100644 index 00000000000..e90676e80c0 --- /dev/null +++ b/models/fetch_detail.go @@ -0,0 +1,204 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type FetchDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewFetchDetail instantiates a new FetchDetail and sets the default values. +func NewFetchDetail() *FetchDetail { + m := &FetchDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateFetchDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFetchDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFetchDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *FetchDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *FetchDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDurationMs gets the durationMs property value. The durationMs property +// returns a *int32 when successful +func (m *FetchDetail) GetDurationMs() *int32 { + val, err := m.GetBackingStore().Get("durationMs") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *FetchDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["durationMs"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDurationMs(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["path"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *FetchDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *FetchDetail) GetPath() *string { + val, err := m.GetBackingStore().Get("path") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *FetchDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteInt32Value("durationMs", m.GetDurationMs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *FetchDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *FetchDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDurationMs sets the durationMs property value. The durationMs property +func (m *FetchDetail) SetDurationMs(value *int32) { + err := m.GetBackingStore().Set("durationMs", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *FetchDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetPath sets the path property value. The path property +func (m *FetchDetail) SetPath(value *string) { + err := m.GetBackingStore().Set("path", value) + if err != nil { + panic(err) + } +} + +type FetchDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDurationMs() *int32 + GetOdataType() *string + GetPath() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDurationMs(value *int32) + SetOdataType(value *string) + SetPath(value *string) +} diff --git a/models/fetch_response.go b/models/fetch_response.go new file mode 100644 index 00000000000..87c2382fc1c --- /dev/null +++ b/models/fetch_response.go @@ -0,0 +1,243 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type FetchResponse struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewFetchResponse instantiates a new FetchResponse and sets the default values. +func NewFetchResponse() *FetchResponse { + m := &FetchResponse{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateFetchResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFetchResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFetchResponse(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *FetchResponse) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *FetchResponse) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetCode gets the code property value. The code property +// returns a *int32 when successful +func (m *FetchResponse) GetCode() *int32 { + val, err := m.GetBackingStore().Get("code") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetData gets the data property value. The data property +// returns a UntypedNodeable when successful +func (m *FetchResponse) GetData() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("data") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *FetchResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["code"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["data"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetData(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["relativePathUri"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRelativePathUri(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *FetchResponse) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetRelativePathUri gets the relativePathUri property value. The relativePathUri property +// returns a *string when successful +func (m *FetchResponse) GetRelativePathUri() *string { + val, err := m.GetBackingStore().Get("relativePathUri") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *FetchResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteInt32Value("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("data", m.GetData()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("relativePathUri", m.GetRelativePathUri()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *FetchResponse) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *FetchResponse) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetCode sets the code property value. The code property +func (m *FetchResponse) SetCode(value *int32) { + err := m.GetBackingStore().Set("code", value) + if err != nil { + panic(err) + } +} + +// SetData sets the data property value. The data property +func (m *FetchResponse) SetData(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("data", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *FetchResponse) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetRelativePathUri sets the relativePathUri property value. The relativePathUri property +func (m *FetchResponse) SetRelativePathUri(value *string) { + err := m.GetBackingStore().Set("relativePathUri", value) + if err != nil { + panic(err) + } +} + +type FetchResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetCode() *int32 + GetData() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetOdataType() *string + GetRelativePathUri() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetCode(value *int32) + SetData(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetOdataType(value *string) + SetRelativePathUri(value *string) +} diff --git a/models/goal.go b/models/goal.go index 8759200e630..967edfc2b4b 100644 --- a/models/goal.go +++ b/models/goal.go @@ -319,7 +319,7 @@ func (m *Goal) GetNotes() ItemBodyable { return nil } -// GetPlanId gets the planId property value. ID of the plan that contains the goal. Required, and immutable after creation. +// GetPlanId gets the planId property value. ID of the plan that contains the goal. Immutable after creation. // returns a *string when successful func (m *Goal) GetPlanId() *string { val, err := m.GetBackingStore().Get("planId") @@ -552,7 +552,7 @@ func (m *Goal) SetNotes(value ItemBodyable) { } } -// SetPlanId sets the planId property value. ID of the plan that contains the goal. Required, and immutable after creation. +// SetPlanId sets the planId property value. ID of the plan that contains the goal. Immutable after creation. func (m *Goal) SetPlanId(value *string) { err := m.GetBackingStore().Set("planId", value) if err != nil { diff --git a/models/group.go b/models/group.go index 97f93e597ee..1bf13ebb546 100644 --- a/models/group.go +++ b/models/group.go @@ -729,6 +729,16 @@ func (m *Group) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388 } return nil } + res["isHardDeleteProtectionEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsHardDeleteProtectionEnabled(val) + } + return nil + } res["isManagementRestricted"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { @@ -1481,6 +1491,19 @@ func (m *Group) GetIsFavorite() *bool { return nil } +// GetIsHardDeleteProtectionEnabled gets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the group. Supported for cloud-only groups. When true, permanent deletion is blocked for seven days after soft deletion. The group can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing group by using Update group; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +// returns a *bool when successful +func (m *Group) GetIsHardDeleteProtectionEnabled() *bool { + val, err := m.GetBackingStore().Get("isHardDeleteProtectionEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + // GetIsManagementRestricted gets the isManagementRestricted property value. Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. // returns a *bool when successful func (m *Group) GetIsManagementRestricted() *bool { @@ -2435,6 +2458,12 @@ func (m *Group) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c4 return err } } + { + err = writer.WriteBoolValue("isHardDeleteProtectionEnabled", m.GetIsHardDeleteProtectionEnabled()) + if err != nil { + return err + } + } { err = writer.WriteBoolValue("isManagementRestricted", m.GetIsManagementRestricted()) if err != nil { @@ -3096,6 +3125,14 @@ func (m *Group) SetIsFavorite(value *bool) { } } +// SetIsHardDeleteProtectionEnabled sets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the group. Supported for cloud-only groups. When true, permanent deletion is blocked for seven days after soft deletion. The group can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing group by using Update group; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +func (m *Group) SetIsHardDeleteProtectionEnabled(value *bool) { + err := m.GetBackingStore().Set("isHardDeleteProtectionEnabled", value) + if err != nil { + panic(err) + } +} + // SetIsManagementRestricted sets the isManagementRestricted property value. Indicates whether the group is a member of a restricted management administrative unit. If not set, the default value is null and the default behavior is false. Read-only. To manage a group member of a restricted management administrative unit, the administrator or calling app must be assigned a Microsoft Entra role at the scope of the restricted management administrative unit. func (m *Group) SetIsManagementRestricted(value *bool) { err := m.GetBackingStore().Set("isManagementRestricted", value) @@ -3555,6 +3592,7 @@ type Groupable interface { GetIsArchived() *bool GetIsAssignableToRole() *bool GetIsFavorite() *bool + GetIsHardDeleteProtectionEnabled() *bool GetIsManagementRestricted() *bool GetIsSubscribedByMail() *bool GetLicenseProcessingState() LicenseProcessingStateable @@ -3640,6 +3678,7 @@ type Groupable interface { SetIsArchived(value *bool) SetIsAssignableToRole(value *bool) SetIsFavorite(value *bool) + SetIsHardDeleteProtectionEnabled(value *bool) SetIsManagementRestricted(value *bool) SetIsSubscribedByMail(value *bool) SetLicenseProcessingState(value LicenseProcessingStateable) diff --git a/models/healthmonitoring/alert_type.go b/models/healthmonitoring/alert_type.go index 41f67331f63..cc19082ed1b 100644 --- a/models/healthmonitoring/alert_type.go +++ b/models/healthmonitoring/alert_type.go @@ -17,10 +17,12 @@ const ( PRIVATEAPPBLOCKEDBYCONNECTOR_ALERTTYPE REMOTENETWORKTUNNELCONNECTIVITY_ALERTTYPE REMOTENETWORKBGPCONNECTIVITY_ALERTTYPE + AGENTIDAUTONOMOUSSIGNINFAILURE_ALERTTYPE + AGENTIDINTERACTIVESIGNINFAILURE_ALERTTYPE ) func (i AlertType) String() string { - return []string{"unknown", "mfaSignInFailure", "managedDeviceSignInFailure", "compliantDeviceSignInFailure", "unknownFutureValue", "conditionalAccessBlockedSignIn", "samlSignInFailure", "internetAppBlockedByPolicy", "privateAppBlockedByConnector", "remoteNetworkTunnelConnectivity", "remoteNetworkBgpConnectivity"}[i] + return []string{"unknown", "mfaSignInFailure", "managedDeviceSignInFailure", "compliantDeviceSignInFailure", "unknownFutureValue", "conditionalAccessBlockedSignIn", "samlSignInFailure", "internetAppBlockedByPolicy", "privateAppBlockedByConnector", "remoteNetworkTunnelConnectivity", "remoteNetworkBgpConnectivity", "agentIdAutonomousSignInFailure", "agentIdInteractiveSignInFailure"}[i] } func ParseAlertType(v string) (any, error) { @@ -48,6 +50,10 @@ func ParseAlertType(v string) (any, error) { result = REMOTENETWORKTUNNELCONNECTIVITY_ALERTTYPE case "remoteNetworkBgpConnectivity": result = REMOTENETWORKBGPCONNECTIVITY_ALERTTYPE + case "agentIdAutonomousSignInFailure": + result = AGENTIDAUTONOMOUSSIGNINFAILURE_ALERTTYPE + case "agentIdInteractiveSignInFailure": + result = AGENTIDINTERACTIVESIGNINFAILURE_ALERTTYPE default: return nil, nil } diff --git a/models/healthmonitoring/scenario.go b/models/healthmonitoring/scenario.go index 67b6da102c2..08c84cd1a7c 100644 --- a/models/healthmonitoring/scenario.go +++ b/models/healthmonitoring/scenario.go @@ -13,10 +13,11 @@ const ( CONDITIONALACCESS_SCENARIO SAML_SCENARIO GSA_SCENARIO + AGENTID_SCENARIO ) func (i Scenario) String() string { - return []string{"unknown", "mfa", "devices", "unknownFutureValue", "conditionalAccess", "saml", "gsa"}[i] + return []string{"unknown", "mfa", "devices", "unknownFutureValue", "conditionalAccess", "saml", "gsa", "agentId"}[i] } func ParseScenario(v string) (any, error) { @@ -36,6 +37,8 @@ func ParseScenario(v string) (any, error) { result = SAML_SCENARIO case "gsa": result = GSA_SCENARIO + case "agentId": + result = AGENTID_SCENARIO default: return nil, nil } diff --git a/models/id_jag_application_configuration.go b/models/id_jag_application_configuration.go new file mode 100644 index 00000000000..fb4a6b93cd1 --- /dev/null +++ b/models/id_jag_application_configuration.go @@ -0,0 +1,204 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type IdJagApplicationConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagApplicationConfiguration instantiates a new IdJagApplicationConfiguration and sets the default values. +func NewIdJagApplicationConfiguration() *IdJagApplicationConfiguration { + m := &IdJagApplicationConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagApplicationConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagApplicationConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagApplicationConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagApplicationConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagApplicationConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetClient gets the client property value. The client property +// returns a IdJagClientConfigurationable when successful +func (m *IdJagApplicationConfiguration) GetClient() IdJagClientConfigurationable { + val, err := m.GetBackingStore().Get("client") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdJagClientConfigurationable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagApplicationConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["client"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdJagClientConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClient(val.(IdJagClientConfigurationable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["resourceAuthorizationServer"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdJagResourceAuthorizationServerConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResourceAuthorizationServer(val.(IdJagResourceAuthorizationServerConfigurationable)) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagApplicationConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetResourceAuthorizationServer gets the resourceAuthorizationServer property value. The resourceAuthorizationServer property +// returns a IdJagResourceAuthorizationServerConfigurationable when successful +func (m *IdJagApplicationConfiguration) GetResourceAuthorizationServer() IdJagResourceAuthorizationServerConfigurationable { + val, err := m.GetBackingStore().Get("resourceAuthorizationServer") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdJagResourceAuthorizationServerConfigurationable) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagApplicationConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("client", m.GetClient()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resourceAuthorizationServer", m.GetResourceAuthorizationServer()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagApplicationConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagApplicationConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetClient sets the client property value. The client property +func (m *IdJagApplicationConfiguration) SetClient(value IdJagClientConfigurationable) { + err := m.GetBackingStore().Set("client", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagApplicationConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetResourceAuthorizationServer sets the resourceAuthorizationServer property value. The resourceAuthorizationServer property +func (m *IdJagApplicationConfiguration) SetResourceAuthorizationServer(value IdJagResourceAuthorizationServerConfigurationable) { + err := m.GetBackingStore().Set("resourceAuthorizationServer", value) + if err != nil { + panic(err) + } +} + +type IdJagApplicationConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetClient() IdJagClientConfigurationable + GetOdataType() *string + GetResourceAuthorizationServer() IdJagResourceAuthorizationServerConfigurationable + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetClient(value IdJagClientConfigurationable) + SetOdataType(value *string) + SetResourceAuthorizationServer(value IdJagResourceAuthorizationServerConfigurationable) +} diff --git a/models/id_jag_client_configuration.go b/models/id_jag_client_configuration.go new file mode 100644 index 00000000000..575427e5a83 --- /dev/null +++ b/models/id_jag_client_configuration.go @@ -0,0 +1,166 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// IdJagClientConfiguration calling-client opt-in configuration for ID-JAG. The application must be confidential-client-capable. +type IdJagClientConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagClientConfiguration instantiates a new IdJagClientConfiguration and sets the default values. +func NewIdJagClientConfiguration() *IdJagClientConfiguration { + m := &IdJagClientConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagClientConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagClientConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagClientConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagClientConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagClientConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagClientConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["isEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsEnabled(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetIsEnabled gets the isEnabled property value. Required and non-null when client configuration is supplied. Indicates whether the application is enabled to request ID-JAG issuance. true conflicts with a non-null idJag.resourceAuthorizationServer child. +// returns a *bool when successful +func (m *IdJagClientConfiguration) GetIsEnabled() *bool { + val, err := m.GetBackingStore().Get("isEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagClientConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagClientConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteBoolValue("isEnabled", m.GetIsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagClientConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagClientConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetIsEnabled sets the isEnabled property value. Required and non-null when client configuration is supplied. Indicates whether the application is enabled to request ID-JAG issuance. true conflicts with a non-null idJag.resourceAuthorizationServer child. +func (m *IdJagClientConfiguration) SetIsEnabled(value *bool) { + err := m.GetBackingStore().Set("isEnabled", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagClientConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type IdJagClientConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetIsEnabled() *bool + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetIsEnabled(value *bool) + SetOdataType(value *string) +} diff --git a/models/id_jag_enabled_client.go b/models/id_jag_enabled_client.go new file mode 100644 index 00000000000..140a7a6adf7 --- /dev/null +++ b/models/id_jag_enabled_client.go @@ -0,0 +1,206 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// IdJagEnabledClient maps an enabled Entra client application to its identifier at the Resource Authorization Server. +type IdJagEnabledClient struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagEnabledClient instantiates a new IdJagEnabledClient and sets the default values. +func NewIdJagEnabledClient() *IdJagEnabledClient { + m := &IdJagEnabledClient{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagEnabledClientFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagEnabledClientFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagEnabledClient(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagEnabledClient) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagEnabledClient) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetClientId gets the clientId property value. Required and non-null in each enabled-client entry. The appId of the client application in Microsoft Entra. +// returns a *UUID when successful +func (m *IdJagEnabledClient) GetClientId() *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID { + val, err := m.GetBackingStore().Get("clientId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagEnabledClient) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["clientId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetUUIDValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["resourceAuthorizationServerClientId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResourceAuthorizationServerClientId(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagEnabledClient) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetResourceAuthorizationServerClientId gets the resourceAuthorizationServerClientId property value. Required and non-null in each enabled-client entry. The client identifier registered for this client at the Resource Authorization Server. +// returns a *string when successful +func (m *IdJagEnabledClient) GetResourceAuthorizationServerClientId() *string { + val, err := m.GetBackingStore().Get("resourceAuthorizationServerClientId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagEnabledClient) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteUUIDValue("clientId", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resourceAuthorizationServerClientId", m.GetResourceAuthorizationServerClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagEnabledClient) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagEnabledClient) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetClientId sets the clientId property value. Required and non-null in each enabled-client entry. The appId of the client application in Microsoft Entra. +func (m *IdJagEnabledClient) SetClientId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { + err := m.GetBackingStore().Set("clientId", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagEnabledClient) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetResourceAuthorizationServerClientId sets the resourceAuthorizationServerClientId property value. Required and non-null in each enabled-client entry. The client identifier registered for this client at the Resource Authorization Server. +func (m *IdJagEnabledClient) SetResourceAuthorizationServerClientId(value *string) { + err := m.GetBackingStore().Set("resourceAuthorizationServerClientId", value) + if err != nil { + panic(err) + } +} + +type IdJagEnabledClientable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetClientId() *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID + GetOdataType() *string + GetResourceAuthorizationServerClientId() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetClientId(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + SetOdataType(value *string) + SetResourceAuthorizationServerClientId(value *string) +} diff --git a/models/id_jag_identifier_uri_configuration.go b/models/id_jag_identifier_uri_configuration.go new file mode 100644 index 00000000000..e286943bc60 --- /dev/null +++ b/models/id_jag_identifier_uri_configuration.go @@ -0,0 +1,172 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// IdJagIdentifierUriConfiguration identifier URIs classified for the ID-JAG protocol. Each value must also exist exactly in the application's top-level identifierUris. Clearing this classification doesn't remove top-level identifierUris; complete deletion requires removing the URI from identifierUris and every referencing protocol classification in the same Application PATCH. Must use HTTPS; api://, wildcards, query strings, fragments, and explicit ports 80 or 443 are not supported. Other explicit ports remain significant. Values are compared using Unicode code-point equality without URI normalization. +type IdJagIdentifierUriConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagIdentifierUriConfiguration instantiates a new IdJagIdentifierUriConfiguration and sets the default values. +func NewIdJagIdentifierUriConfiguration() *IdJagIdentifierUriConfiguration { + m := &IdJagIdentifierUriConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagIdentifierUriConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagIdentifierUriConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagIdentifierUriConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagIdentifierUriConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagIdentifierUriConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagIdentifierUriConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["uris"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUris(res) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagIdentifierUriConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUris gets the uris property value. Required and non-null when ID-JAG identifier URI configuration is supplied. Application identifier URIs opted into outbound ID-JAG. Must exactly match values in top-level identifierUris in the prospective final state. Explicit ports 80 and 443 are rejected; other ports remain significant. An empty collection normalizes the parent to null without changing top-level identifierUris. +// returns a []string when successful +func (m *IdJagIdentifierUriConfiguration) GetUris() []string { + val, err := m.GetBackingStore().Get("uris") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagIdentifierUriConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetUris() != nil { + err := writer.WriteCollectionOfStringValues("uris", m.GetUris()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagIdentifierUriConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagIdentifierUriConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagIdentifierUriConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetUris sets the uris property value. Required and non-null when ID-JAG identifier URI configuration is supplied. Application identifier URIs opted into outbound ID-JAG. Must exactly match values in top-level identifierUris in the prospective final state. Explicit ports 80 and 443 are rejected; other ports remain significant. An empty collection normalizes the parent to null without changing top-level identifierUris. +func (m *IdJagIdentifierUriConfiguration) SetUris(value []string) { + err := m.GetBackingStore().Set("uris", value) + if err != nil { + panic(err) + } +} + +type IdJagIdentifierUriConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetUris() []string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetUris(value []string) +} diff --git a/models/id_jag_resource_authorization_server_configuration.go b/models/id_jag_resource_authorization_server_configuration.go new file mode 100644 index 00000000000..708ff070d6b --- /dev/null +++ b/models/id_jag_resource_authorization_server_configuration.go @@ -0,0 +1,178 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// IdJagResourceAuthorizationServerConfiguration iD-JAG Resource Authorization Server configuration for an application. A non-null resourceAuthorizationServer child counts as resource configuration even when resourceServers is empty. Requires signInAudience AzureADMyOrg. +type IdJagResourceAuthorizationServerConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagResourceAuthorizationServerConfiguration instantiates a new IdJagResourceAuthorizationServerConfiguration and sets the default values. +func NewIdJagResourceAuthorizationServerConfiguration() *IdJagResourceAuthorizationServerConfiguration { + m := &IdJagResourceAuthorizationServerConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagResourceAuthorizationServerConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagResourceAuthorizationServerConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagResourceAuthorizationServerConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagResourceAuthorizationServerConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagResourceAuthorizationServerConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagResourceAuthorizationServerConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["resourceServers"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIdJagResourceServerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IdJagResourceServerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IdJagResourceServerable) + } + } + m.SetResourceServers(res) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagResourceAuthorizationServerConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetResourceServers gets the resourceServers property value. Required and non-null when resource configuration is supplied. Resource server URI and scope mappings. +// returns a []IdJagResourceServerable when successful +func (m *IdJagResourceAuthorizationServerConfiguration) GetResourceServers() []IdJagResourceServerable { + val, err := m.GetBackingStore().Get("resourceServers") + if err != nil { + panic(err) + } + if val != nil { + return val.([]IdJagResourceServerable) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagResourceAuthorizationServerConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetResourceServers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetResourceServers())) + for i, v := range m.GetResourceServers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("resourceServers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagResourceAuthorizationServerConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagResourceAuthorizationServerConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagResourceAuthorizationServerConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetResourceServers sets the resourceServers property value. Required and non-null when resource configuration is supplied. Resource server URI and scope mappings. +func (m *IdJagResourceAuthorizationServerConfiguration) SetResourceServers(value []IdJagResourceServerable) { + err := m.GetBackingStore().Set("resourceServers", value) + if err != nil { + panic(err) + } +} + +type IdJagResourceAuthorizationServerConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetResourceServers() []IdJagResourceServerable + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetResourceServers(value []IdJagResourceServerable) +} diff --git a/models/id_jag_resource_server.go b/models/id_jag_resource_server.go new file mode 100644 index 00000000000..f6353e17bcc --- /dev/null +++ b/models/id_jag_resource_server.go @@ -0,0 +1,303 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// IdJagResourceServer configures resource URI matching and Resource Authorization Server scope mapping for one ID-JAG resource server. Across entries, overlapping normalized resource domains are allowed only when every common accepted external scope resolves to the same Entra OAuth2 permission. +type IdJagResourceServer struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagResourceServer instantiates a new IdJagResourceServer and sets the default values. +func NewIdJagResourceServer() *IdJagResourceServer { + m := &IdJagResourceServer{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagResourceServerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagResourceServerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagResourceServer(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagResourceServer) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagResourceServer) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagResourceServer) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["resourceServerUriMatchType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseIdJagResourceServerUriMatchType) + if err != nil { + return err + } + if val != nil { + m.SetResourceServerUriMatchType(val.(*IdJagResourceServerUriMatchType)) + } + return nil + } + res["resourceServerUris"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetResourceServerUris(res) + } + return nil + } + res["scopeMappings"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIdJagScopeMappingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IdJagScopeMappingable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IdJagScopeMappingable) + } + } + m.SetScopeMappings(res) + } + return nil + } + res["scopeMappingType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseIdJagScopeMappingType) + if err != nil { + return err + } + if val != nil { + m.SetScopeMappingType(val.(*IdJagScopeMappingType)) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagResourceServer) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetResourceServerUriMatchType gets the resourceServerUriMatchType property value. Required and non-null in each resource server entry. Matching precedence is exact, longest pathPrefix, then anyURI; absent applies only when no resource is supplied. Overlap is rejected when a common accepted external scope resolves to a different Entra OAuth2 permission across entries. +// returns a *IdJagResourceServerUriMatchType when successful +func (m *IdJagResourceServer) GetResourceServerUriMatchType() *IdJagResourceServerUriMatchType { + val, err := m.GetBackingStore().Get("resourceServerUriMatchType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*IdJagResourceServerUriMatchType) + } + return nil +} + +// GetResourceServerUris gets the resourceServerUris property value. Required and non-null in each resource server entry. Non-empty for exact and pathPrefix; empty for absent and anyURI. +// returns a []string when successful +func (m *IdJagResourceServer) GetResourceServerUris() []string { + val, err := m.GetBackingStore().Get("resourceServerUris") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// GetScopeMappings gets the scopeMappings property value. Required and non-null in each resource server entry. Empty for direct, non-empty for mapped, and exactly one entry with an empty validResourceAuthorizationServerScopes collection for passthrough. +// returns a []IdJagScopeMappingable when successful +func (m *IdJagResourceServer) GetScopeMappings() []IdJagScopeMappingable { + val, err := m.GetBackingStore().Get("scopeMappings") + if err != nil { + panic(err) + } + if val != nil { + return val.([]IdJagScopeMappingable) + } + return nil +} + +// GetScopeMappingType gets the scopeMappingType property value. Required and non-null in each resource server entry. Specifies direct, mapped, or passthrough scope behavior used to detect contradictory scope-to-permission outcomes across overlapping resource domains. +// returns a *IdJagScopeMappingType when successful +func (m *IdJagResourceServer) GetScopeMappingType() *IdJagScopeMappingType { + val, err := m.GetBackingStore().Get("scopeMappingType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*IdJagScopeMappingType) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagResourceServer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetResourceServerUriMatchType() != nil { + cast := (*m.GetResourceServerUriMatchType()).String() + err := writer.WriteStringValue("resourceServerUriMatchType", &cast) + if err != nil { + return err + } + } + if m.GetResourceServerUris() != nil { + err := writer.WriteCollectionOfStringValues("resourceServerUris", m.GetResourceServerUris()) + if err != nil { + return err + } + } + if m.GetScopeMappings() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetScopeMappings())) + for i, v := range m.GetScopeMappings() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("scopeMappings", cast) + if err != nil { + return err + } + } + if m.GetScopeMappingType() != nil { + cast := (*m.GetScopeMappingType()).String() + err := writer.WriteStringValue("scopeMappingType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagResourceServer) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagResourceServer) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagResourceServer) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetResourceServerUriMatchType sets the resourceServerUriMatchType property value. Required and non-null in each resource server entry. Matching precedence is exact, longest pathPrefix, then anyURI; absent applies only when no resource is supplied. Overlap is rejected when a common accepted external scope resolves to a different Entra OAuth2 permission across entries. +func (m *IdJagResourceServer) SetResourceServerUriMatchType(value *IdJagResourceServerUriMatchType) { + err := m.GetBackingStore().Set("resourceServerUriMatchType", value) + if err != nil { + panic(err) + } +} + +// SetResourceServerUris sets the resourceServerUris property value. Required and non-null in each resource server entry. Non-empty for exact and pathPrefix; empty for absent and anyURI. +func (m *IdJagResourceServer) SetResourceServerUris(value []string) { + err := m.GetBackingStore().Set("resourceServerUris", value) + if err != nil { + panic(err) + } +} + +// SetScopeMappings sets the scopeMappings property value. Required and non-null in each resource server entry. Empty for direct, non-empty for mapped, and exactly one entry with an empty validResourceAuthorizationServerScopes collection for passthrough. +func (m *IdJagResourceServer) SetScopeMappings(value []IdJagScopeMappingable) { + err := m.GetBackingStore().Set("scopeMappings", value) + if err != nil { + panic(err) + } +} + +// SetScopeMappingType sets the scopeMappingType property value. Required and non-null in each resource server entry. Specifies direct, mapped, or passthrough scope behavior used to detect contradictory scope-to-permission outcomes across overlapping resource domains. +func (m *IdJagResourceServer) SetScopeMappingType(value *IdJagScopeMappingType) { + err := m.GetBackingStore().Set("scopeMappingType", value) + if err != nil { + panic(err) + } +} + +type IdJagResourceServerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetResourceServerUriMatchType() *IdJagResourceServerUriMatchType + GetResourceServerUris() []string + GetScopeMappings() []IdJagScopeMappingable + GetScopeMappingType() *IdJagScopeMappingType + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetResourceServerUriMatchType(value *IdJagResourceServerUriMatchType) + SetResourceServerUris(value []string) + SetScopeMappings(value []IdJagScopeMappingable) + SetScopeMappingType(value *IdJagScopeMappingType) +} diff --git a/models/id_jag_resource_server_uri_match_type.go b/models/id_jag_resource_server_uri_match_type.go new file mode 100644 index 00000000000..92c54b7a554 --- /dev/null +++ b/models/id_jag_resource_server_uri_match_type.go @@ -0,0 +1,50 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// Specifies how an ID-JAG resource server matches a supplied resource URI. +type IdJagResourceServerUriMatchType int + +const ( + ABSENT_IDJAGRESOURCESERVERURIMATCHTYPE IdJagResourceServerUriMatchType = iota + EXACT_IDJAGRESOURCESERVERURIMATCHTYPE + PATHPREFIX_IDJAGRESOURCESERVERURIMATCHTYPE + ANYURI_IDJAGRESOURCESERVERURIMATCHTYPE + UNKNOWNFUTUREVALUE_IDJAGRESOURCESERVERURIMATCHTYPE +) + +func (i IdJagResourceServerUriMatchType) String() string { + return []string{"absent", "exact", "pathPrefix", "anyURI", "unknownFutureValue"}[i] +} + +func ParseIdJagResourceServerUriMatchType(v string) (any, error) { + result := ABSENT_IDJAGRESOURCESERVERURIMATCHTYPE + switch v { + case "absent": + result = ABSENT_IDJAGRESOURCESERVERURIMATCHTYPE + case "exact": + result = EXACT_IDJAGRESOURCESERVERURIMATCHTYPE + case "pathPrefix": + result = PATHPREFIX_IDJAGRESOURCESERVERURIMATCHTYPE + case "anyURI": + result = ANYURI_IDJAGRESOURCESERVERURIMATCHTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_IDJAGRESOURCESERVERURIMATCHTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeIdJagResourceServerUriMatchType(values []IdJagResourceServerUriMatchType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i IdJagResourceServerUriMatchType) isMultiValue() bool { + return false +} diff --git a/models/id_jag_scope_mapping.go b/models/id_jag_scope_mapping.go new file mode 100644 index 00000000000..a7ef8827d35 --- /dev/null +++ b/models/id_jag_scope_mapping.go @@ -0,0 +1,211 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// IdJagScopeMapping maps Resource Authorization Server scopes to an Entra OAuth2 permission. +type IdJagScopeMapping struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagScopeMapping instantiates a new IdJagScopeMapping and sets the default values. +func NewIdJagScopeMapping() *IdJagScopeMapping { + m := &IdJagScopeMapping{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagScopeMappingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagScopeMappingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagScopeMapping(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagScopeMapping) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagScopeMapping) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagScopeMapping) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["oauth2Permission"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOauth2Permission(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["validResourceAuthorizationServerScopes"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetValidResourceAuthorizationServerScopes(res) + } + return nil + } + return res +} + +// GetOauth2Permission gets the oauth2Permission property value. Required and non-null in each scope mapping. An enabled delegated permission exposed by the resource application for ID-JAG use. +// returns a *string when successful +func (m *IdJagScopeMapping) GetOauth2Permission() *string { + val, err := m.GetBackingStore().Get("oauth2Permission") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagScopeMapping) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetValidResourceAuthorizationServerScopes gets the validResourceAuthorizationServerScopes property value. Required and non-null in each scope mapping. One or two equivalent, case-sensitive Resource Authorization Server scopes for mapped behavior; empty for the single passthrough mapping. +// returns a []string when successful +func (m *IdJagScopeMapping) GetValidResourceAuthorizationServerScopes() []string { + val, err := m.GetBackingStore().Get("validResourceAuthorizationServerScopes") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagScopeMapping) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("oauth2Permission", m.GetOauth2Permission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetValidResourceAuthorizationServerScopes() != nil { + err := writer.WriteCollectionOfStringValues("validResourceAuthorizationServerScopes", m.GetValidResourceAuthorizationServerScopes()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagScopeMapping) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagScopeMapping) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOauth2Permission sets the oauth2Permission property value. Required and non-null in each scope mapping. An enabled delegated permission exposed by the resource application for ID-JAG use. +func (m *IdJagScopeMapping) SetOauth2Permission(value *string) { + err := m.GetBackingStore().Set("oauth2Permission", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagScopeMapping) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetValidResourceAuthorizationServerScopes sets the validResourceAuthorizationServerScopes property value. Required and non-null in each scope mapping. One or two equivalent, case-sensitive Resource Authorization Server scopes for mapped behavior; empty for the single passthrough mapping. +func (m *IdJagScopeMapping) SetValidResourceAuthorizationServerScopes(value []string) { + err := m.GetBackingStore().Set("validResourceAuthorizationServerScopes", value) + if err != nil { + panic(err) + } +} + +type IdJagScopeMappingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOauth2Permission() *string + GetOdataType() *string + GetValidResourceAuthorizationServerScopes() []string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOauth2Permission(value *string) + SetOdataType(value *string) + SetValidResourceAuthorizationServerScopes(value []string) +} diff --git a/models/id_jag_scope_mapping_type.go b/models/id_jag_scope_mapping_type.go new file mode 100644 index 00000000000..6b020fcffe2 --- /dev/null +++ b/models/id_jag_scope_mapping_type.go @@ -0,0 +1,47 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// Specifies how Resource Authorization Server scopes resolve to an Entra OAuth2 permission. +type IdJagScopeMappingType int + +const ( + DIRECT_IDJAGSCOPEMAPPINGTYPE IdJagScopeMappingType = iota + MAPPED_IDJAGSCOPEMAPPINGTYPE + PASSTHROUGH_IDJAGSCOPEMAPPINGTYPE + UNKNOWNFUTUREVALUE_IDJAGSCOPEMAPPINGTYPE +) + +func (i IdJagScopeMappingType) String() string { + return []string{"direct", "mapped", "passthrough", "unknownFutureValue"}[i] +} + +func ParseIdJagScopeMappingType(v string) (any, error) { + result := DIRECT_IDJAGSCOPEMAPPINGTYPE + switch v { + case "direct": + result = DIRECT_IDJAGSCOPEMAPPINGTYPE + case "mapped": + result = MAPPED_IDJAGSCOPEMAPPINGTYPE + case "passthrough": + result = PASSTHROUGH_IDJAGSCOPEMAPPINGTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_IDJAGSCOPEMAPPINGTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeIdJagScopeMappingType(values []IdJagScopeMappingType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i IdJagScopeMappingType) isMultiValue() bool { + return false +} diff --git a/models/id_jag_service_principal_configuration.go b/models/id_jag_service_principal_configuration.go new file mode 100644 index 00000000000..33b8ed61d0d --- /dev/null +++ b/models/id_jag_service_principal_configuration.go @@ -0,0 +1,216 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type IdJagServicePrincipalConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewIdJagServicePrincipalConfiguration instantiates a new IdJagServicePrincipalConfiguration and sets the default values. +func NewIdJagServicePrincipalConfiguration() *IdJagServicePrincipalConfiguration { + m := &IdJagServicePrincipalConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateIdJagServicePrincipalConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdJagServicePrincipalConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdJagServicePrincipalConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *IdJagServicePrincipalConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *IdJagServicePrincipalConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetEnabledClients gets the enabledClients property value. Required and non-null when ServicePrincipal ID-JAG configuration is supplied. Maps enabled Entra clients to their Resource Authorization Server client identifiers. This is the only supported ID-JAG child on agentIdentityBlueprintPrincipal and agentIdentity. +// returns a []IdJagEnabledClientable when successful +func (m *IdJagServicePrincipalConfiguration) GetEnabledClients() []IdJagEnabledClientable { + val, err := m.GetBackingStore().Get("enabledClients") + if err != nil { + panic(err) + } + if val != nil { + return val.([]IdJagEnabledClientable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdJagServicePrincipalConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["enabledClients"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIdJagEnabledClientFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IdJagEnabledClientable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IdJagEnabledClientable) + } + } + m.SetEnabledClients(res) + } + return nil + } + res["isEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsEnabled(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetIsEnabled gets the isEnabled property value. Required and non-null when ID-JAG configuration is supplied on a base ServicePrincipal. Indicates whether ID-JAG issuance is enabled for this tenant-local resource. Not supported on agentIdentityBlueprintPrincipal or agentIdentity; returned as null and rejected on write. +// returns a *bool when successful +func (m *IdJagServicePrincipalConfiguration) GetIsEnabled() *bool { + val, err := m.GetBackingStore().Get("isEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *IdJagServicePrincipalConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdJagServicePrincipalConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetEnabledClients() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEnabledClients())) + for i, v := range m.GetEnabledClients() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("enabledClients", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isEnabled", m.GetIsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *IdJagServicePrincipalConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *IdJagServicePrincipalConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetEnabledClients sets the enabledClients property value. Required and non-null when ServicePrincipal ID-JAG configuration is supplied. Maps enabled Entra clients to their Resource Authorization Server client identifiers. This is the only supported ID-JAG child on agentIdentityBlueprintPrincipal and agentIdentity. +func (m *IdJagServicePrincipalConfiguration) SetEnabledClients(value []IdJagEnabledClientable) { + err := m.GetBackingStore().Set("enabledClients", value) + if err != nil { + panic(err) + } +} + +// SetIsEnabled sets the isEnabled property value. Required and non-null when ID-JAG configuration is supplied on a base ServicePrincipal. Indicates whether ID-JAG issuance is enabled for this tenant-local resource. Not supported on agentIdentityBlueprintPrincipal or agentIdentity; returned as null and rejected on write. +func (m *IdJagServicePrincipalConfiguration) SetIsEnabled(value *bool) { + err := m.GetBackingStore().Set("isEnabled", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *IdJagServicePrincipalConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type IdJagServicePrincipalConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetEnabledClients() []IdJagEnabledClientable + GetIsEnabled() *bool + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetEnabledClients(value []IdJagEnabledClientable) + SetIsEnabled(value *bool) + SetOdataType(value *string) +} diff --git a/models/identity_set.go b/models/identity_set.go index ccb37cabc1f..24f8d781d7f 100644 --- a/models/identity_set.go +++ b/models/identity_set.go @@ -52,6 +52,8 @@ func CreateIdentitySetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a return NewCustomEmojiFromIdentitySet(), nil case "#microsoft.graph.engagementIdentitySet": return NewEngagementIdentitySet(), nil + case "#microsoft.graph.investigationIdentitySet": + return NewInvestigationIdentitySet(), nil case "#microsoft.graph.sharePointIdentitySet": return NewSharePointIdentitySet(), nil } diff --git a/models/identity_verification_event.go b/models/identity_verification_event.go new file mode 100644 index 00000000000..6486cc2bc1a --- /dev/null +++ b/models/identity_verification_event.go @@ -0,0 +1,165 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IdentityVerificationEvent a single identity verification event with its verification, lifecycle, and optional override details. +type IdentityVerificationEvent struct { + Entity +} + +// NewIdentityVerificationEvent instantiates a new IdentityVerificationEvent and sets the default values. +func NewIdentityVerificationEvent() *IdentityVerificationEvent { + m := &IdentityVerificationEvent{ + Entity: *NewEntity(), + } + return m +} + +// CreateIdentityVerificationEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdentityVerificationEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdentityVerificationEvent(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdentityVerificationEvent) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["lifecycle"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationEventLifecycleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLifecycle(val.(VerificationEventLifecycleable)) + } + return nil + } + res["overrideDetails"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationEventOverrideFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOverrideDetails(val.(VerificationEventOverrideable)) + } + return nil + } + res["verification"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationEventDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(VerificationEventDetailable)) + } + return nil + } + return res +} + +// GetLifecycle gets the lifecycle property value. The source and current lifecycle state of the event. +// returns a VerificationEventLifecycleable when successful +func (m *IdentityVerificationEvent) GetLifecycle() VerificationEventLifecycleable { + val, err := m.GetBackingStore().Get("lifecycle") + if err != nil { + panic(err) + } + if val != nil { + return val.(VerificationEventLifecycleable) + } + return nil +} + +// GetOverrideDetails gets the overrideDetails property value. The administrative or programmatic override applied to the event. null when no override was applied. +// returns a VerificationEventOverrideable when successful +func (m *IdentityVerificationEvent) GetOverrideDetails() VerificationEventOverrideable { + val, err := m.GetBackingStore().Get("overrideDetails") + if err != nil { + panic(err) + } + if val != nil { + return val.(VerificationEventOverrideable) + } + return nil +} + +// GetVerification gets the verification property value. The verification state, provider, credential identifiers, and timestamps. +// returns a VerificationEventDetailable when successful +func (m *IdentityVerificationEvent) GetVerification() VerificationEventDetailable { + val, err := m.GetBackingStore().Get("verification") + if err != nil { + panic(err) + } + if val != nil { + return val.(VerificationEventDetailable) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdentityVerificationEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("lifecycle", m.GetLifecycle()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("overrideDetails", m.GetOverrideDetails()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("verification", m.GetVerification()) + if err != nil { + return err + } + } + return nil +} + +// SetLifecycle sets the lifecycle property value. The source and current lifecycle state of the event. +func (m *IdentityVerificationEvent) SetLifecycle(value VerificationEventLifecycleable) { + err := m.GetBackingStore().Set("lifecycle", value) + if err != nil { + panic(err) + } +} + +// SetOverrideDetails sets the overrideDetails property value. The administrative or programmatic override applied to the event. null when no override was applied. +func (m *IdentityVerificationEvent) SetOverrideDetails(value VerificationEventOverrideable) { + err := m.GetBackingStore().Set("overrideDetails", value) + if err != nil { + panic(err) + } +} + +// SetVerification sets the verification property value. The verification state, provider, credential identifiers, and timestamps. +func (m *IdentityVerificationEvent) SetVerification(value VerificationEventDetailable) { + err := m.GetBackingStore().Set("verification", value) + if err != nil { + panic(err) + } +} + +type IdentityVerificationEventable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLifecycle() VerificationEventLifecycleable + GetOverrideDetails() VerificationEventOverrideable + GetVerification() VerificationEventDetailable + SetLifecycle(value VerificationEventLifecycleable) + SetOverrideDetails(value VerificationEventOverrideable) + SetVerification(value VerificationEventDetailable) +} diff --git a/models/identity_verification_event_collection_response.go b/models/identity_verification_event_collection_response.go new file mode 100644 index 00000000000..a4ac5f63363 --- /dev/null +++ b/models/identity_verification_event_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IdentityVerificationEventCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewIdentityVerificationEventCollectionResponse instantiates a new IdentityVerificationEventCollectionResponse and sets the default values. +func NewIdentityVerificationEventCollectionResponse() *IdentityVerificationEventCollectionResponse { + m := &IdentityVerificationEventCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateIdentityVerificationEventCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdentityVerificationEventCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdentityVerificationEventCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdentityVerificationEventCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIdentityVerificationEventFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IdentityVerificationEventable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IdentityVerificationEventable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []IdentityVerificationEventable when successful +func (m *IdentityVerificationEventCollectionResponse) GetValue() []IdentityVerificationEventable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]IdentityVerificationEventable) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdentityVerificationEventCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *IdentityVerificationEventCollectionResponse) SetValue(value []IdentityVerificationEventable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type IdentityVerificationEventCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []IdentityVerificationEventable + SetValue(value []IdentityVerificationEventable) +} diff --git a/models/identity_verification_status.go b/models/identity_verification_status.go new file mode 100644 index 00000000000..a29872b03f4 --- /dev/null +++ b/models/identity_verification_status.go @@ -0,0 +1,206 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// IdentityVerificationStatus per-user singleton tracking identity verification state and bounded event history. +type IdentityVerificationStatus struct { + Entity +} + +// NewIdentityVerificationStatus instantiates a new IdentityVerificationStatus and sets the default values. +func NewIdentityVerificationStatus() *IdentityVerificationStatus { + m := &IdentityVerificationStatus{ + Entity: *NewEntity(), + } + return m +} + +// CreateIdentityVerificationStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIdentityVerificationStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIdentityVerificationStatus(), nil +} + +// GetExpiryDateTime gets the expiryDateTime property value. The effective expiry of the user's overall verified state, computed as the latest expiresDateTime across active verification events. null when no active event has an expiry. Read-only. +// returns a *Time when successful +func (m *IdentityVerificationStatus) GetExpiryDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("expiryDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *IdentityVerificationStatus) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["expiryDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiryDateTime(val) + } + return nil + } + res["lastVerifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastVerifiedDateTime(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseVerificationState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*VerificationState)) + } + return nil + } + res["verificationEvents"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIdentityVerificationEventFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IdentityVerificationEventable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IdentityVerificationEventable) + } + } + m.SetVerificationEvents(res) + } + return nil + } + return res +} + +// GetLastVerifiedDateTime gets the lastVerifiedDateTime property value. The date and time of the most recent successful identity verification. null when state is unverified. Read-only. +// returns a *Time when successful +func (m *IdentityVerificationStatus) GetLastVerifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastVerifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetState gets the state property value. The state property +// returns a *VerificationState when successful +func (m *IdentityVerificationStatus) GetState() *VerificationState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*VerificationState) + } + return nil +} + +// GetVerificationEvents gets the verificationEvents property value. The user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +// returns a []IdentityVerificationEventable when successful +func (m *IdentityVerificationStatus) GetVerificationEvents() []IdentityVerificationEventable { + val, err := m.GetBackingStore().Get("verificationEvents") + if err != nil { + panic(err) + } + if val != nil { + return val.([]IdentityVerificationEventable) + } + return nil +} + +// Serialize serializes information the current object +func (m *IdentityVerificationStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err = writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + if m.GetVerificationEvents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVerificationEvents())) + for i, v := range m.GetVerificationEvents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("verificationEvents", cast) + if err != nil { + return err + } + } + return nil +} + +// SetExpiryDateTime sets the expiryDateTime property value. The effective expiry of the user's overall verified state, computed as the latest expiresDateTime across active verification events. null when no active event has an expiry. Read-only. +func (m *IdentityVerificationStatus) SetExpiryDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("expiryDateTime", value) + if err != nil { + panic(err) + } +} + +// SetLastVerifiedDateTime sets the lastVerifiedDateTime property value. The date and time of the most recent successful identity verification. null when state is unverified. Read-only. +func (m *IdentityVerificationStatus) SetLastVerifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastVerifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. The state property +func (m *IdentityVerificationStatus) SetState(value *VerificationState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +// SetVerificationEvents sets the verificationEvents property value. The user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +func (m *IdentityVerificationStatus) SetVerificationEvents(value []IdentityVerificationEventable) { + err := m.GetBackingStore().Set("verificationEvents", value) + if err != nil { + panic(err) + } +} + +type IdentityVerificationStatusable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiryDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetLastVerifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetState() *VerificationState + GetVerificationEvents() []IdentityVerificationEventable + SetExpiryDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastVerifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetState(value *VerificationState) + SetVerificationEvents(value []IdentityVerificationEventable) +} diff --git a/models/investigation_identity_set.go b/models/investigation_identity_set.go new file mode 100644 index 00000000000..b6e8bed7e4a --- /dev/null +++ b/models/investigation_identity_set.go @@ -0,0 +1,83 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InvestigationIdentitySet open investigation provenance extending shared user, application, and device identities with the recorded agent principal. This computed parent provenance grants no execution credentials or cross-tenant authorization. +type InvestigationIdentitySet struct { + IdentitySet +} + +// NewInvestigationIdentitySet instantiates a new InvestigationIdentitySet and sets the default values. +func NewInvestigationIdentitySet() *InvestigationIdentitySet { + m := &InvestigationIdentitySet{ + IdentitySet: *NewIdentitySet(), + } + odataTypeValue := "#microsoft.graph.investigationIdentitySet" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreateInvestigationIdentitySetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationIdentitySetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationIdentitySet(), nil +} + +// GetAgent gets the agent property value. The initiating agent principal, when recorded by the service. +// returns a Identityable when successful +func (m *InvestigationIdentitySet) GetAgent() Identityable { + val, err := m.GetBackingStore().Get("agent") + if err != nil { + panic(err) + } + if val != nil { + return val.(Identityable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationIdentitySet) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.IdentitySet.GetFieldDeserializers() + res["agent"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdentityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAgent(val.(Identityable)) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *InvestigationIdentitySet) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.IdentitySet.Serialize(writer) + if err != nil { + return err + } + return nil +} + +// SetAgent sets the agent property value. The initiating agent principal, when recorded by the service. +func (m *InvestigationIdentitySet) SetAgent(value Identityable) { + err := m.GetBackingStore().Set("agent", value) + if err != nil { + panic(err) + } +} + +type InvestigationIdentitySetable interface { + IdentitySetable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAgent() Identityable + SetAgent(value Identityable) +} diff --git a/models/investigation_input.go b/models/investigation_input.go new file mode 100644 index 00000000000..bc2063a8b49 --- /dev/null +++ b/models/investigation_input.go @@ -0,0 +1,160 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InvestigationInput an addressable reference to an external resource or keyword, contained only by an investigation session and shared as session context across its agent runs. It does not identify the exact input consumed by an individual run. The referenced resource remains external. Inherited id is server-owned, stable and unique within the containing session. New input ids are persisted GUIDs. Historical immutable input records retain deterministic parent-and-slot GUIDs without rewriting stored business identifiers. +type InvestigationInput struct { + Entity +} + +// NewInvestigationInput instantiates a new InvestigationInput and sets the default values. +func NewInvestigationInput() *InvestigationInput { + m := &InvestigationInput{ + Entity: *NewEntity(), + } + return m +} + +// CreateInvestigationInputFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationInputFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationInput(), nil +} + +// GetDisplayName gets the displayName property value. The display name populated by the service when available. Read-only. +// returns a *string when successful +func (m *InvestigationInput) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationInput) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["kind"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInvestigationInputType) + if err != nil { + return err + } + if val != nil { + m.SetKind(val.(*InvestigationInputType)) + } + return nil + } + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} + +// GetKind gets the kind property value. Kind of external resource identifier or keyword supplied to a playbook. +// returns a *InvestigationInputType when successful +func (m *InvestigationInput) GetKind() *InvestigationInputType { + val, err := m.GetBackingStore().Get("kind") + if err != nil { + panic(err) + } + if val != nil { + return val.(*InvestigationInputType) + } + return nil +} + +// GetValue gets the value property value. The type-specific resource identifier or keyword text. Required when creating a session and immutable afterward. +// returns a *string when successful +func (m *InvestigationInput) GetValue() *string { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationInput) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetKind() != nil { + cast := (*m.GetKind()).String() + err = writer.WriteStringValue("kind", &cast) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + return nil +} + +// SetDisplayName sets the displayName property value. The display name populated by the service when available. Read-only. +func (m *InvestigationInput) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetKind sets the kind property value. Kind of external resource identifier or keyword supplied to a playbook. +func (m *InvestigationInput) SetKind(value *InvestigationInputType) { + err := m.GetBackingStore().Set("kind", value) + if err != nil { + panic(err) + } +} + +// SetValue sets the value property value. The type-specific resource identifier or keyword text. Required when creating a session and immutable afterward. +func (m *InvestigationInput) SetValue(value *string) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type InvestigationInputable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplayName() *string + GetKind() *InvestigationInputType + GetValue() *string + SetDisplayName(value *string) + SetKind(value *InvestigationInputType) + SetValue(value *string) +} diff --git a/models/investigation_input_collection_response.go b/models/investigation_input_collection_response.go new file mode 100644 index 00000000000..fefd3515ba3 --- /dev/null +++ b/models/investigation_input_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type InvestigationInputCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewInvestigationInputCollectionResponse instantiates a new InvestigationInputCollectionResponse and sets the default values. +func NewInvestigationInputCollectionResponse() *InvestigationInputCollectionResponse { + m := &InvestigationInputCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateInvestigationInputCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationInputCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationInputCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationInputCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationInputFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationInputable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationInputable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []InvestigationInputable when successful +func (m *InvestigationInputCollectionResponse) GetValue() []InvestigationInputable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationInputable) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationInputCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *InvestigationInputCollectionResponse) SetValue(value []InvestigationInputable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type InvestigationInputCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []InvestigationInputable + SetValue(value []InvestigationInputable) +} diff --git a/models/investigation_input_type.go b/models/investigation_input_type.go new file mode 100644 index 00000000000..2d8d26f44b7 --- /dev/null +++ b/models/investigation_input_type.go @@ -0,0 +1,56 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// Kind of external resource identifier or keyword supplied to a playbook. +type InvestigationInputType int + +const ( + DEFENDERINCIDENTID_INVESTIGATIONINPUTTYPE InvestigationInputType = iota + DEFENDERALERTID_INVESTIGATIONINPUTTYPE + DEFENDERTHREATINTELLIGENCEID_INVESTIGATIONINPUTTYPE + AZURESUBSCRIPTIONID_INVESTIGATIONINPUTTYPE + AZUREIDENTITYID_INVESTIGATIONINPUTTYPE + KEYWORD_INVESTIGATIONINPUTTYPE + UNKNOWNFUTUREVALUE_INVESTIGATIONINPUTTYPE +) + +func (i InvestigationInputType) String() string { + return []string{"defenderIncidentId", "defenderAlertId", "defenderThreatIntelligenceId", "azureSubscriptionId", "azureIdentityId", "keyword", "unknownFutureValue"}[i] +} + +func ParseInvestigationInputType(v string) (any, error) { + result := DEFENDERINCIDENTID_INVESTIGATIONINPUTTYPE + switch v { + case "defenderIncidentId": + result = DEFENDERINCIDENTID_INVESTIGATIONINPUTTYPE + case "defenderAlertId": + result = DEFENDERALERTID_INVESTIGATIONINPUTTYPE + case "defenderThreatIntelligenceId": + result = DEFENDERTHREATINTELLIGENCEID_INVESTIGATIONINPUTTYPE + case "azureSubscriptionId": + result = AZURESUBSCRIPTIONID_INVESTIGATIONINPUTTYPE + case "azureIdentityId": + result = AZUREIDENTITYID_INVESTIGATIONINPUTTYPE + case "keyword": + result = KEYWORD_INVESTIGATIONINPUTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_INVESTIGATIONINPUTTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeInvestigationInputType(values []InvestigationInputType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i InvestigationInputType) isMultiValue() bool { + return false +} diff --git a/models/investigation_message.go b/models/investigation_message.go new file mode 100644 index 00000000000..4897c8058c3 --- /dev/null +++ b/models/investigation_message.go @@ -0,0 +1,306 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// InvestigationMessage addressable transcript entity owned only by an agent run and referenced by the session aggregate. The key explicitly maps Graph id to backend messageId without shadowing an inherited property; ids are unique across the containing session. +type InvestigationMessage struct { + Entity +} + +// NewInvestigationMessage instantiates a new InvestigationMessage and sets the default values. +func NewInvestigationMessage() *InvestigationMessage { + m := &InvestigationMessage{ + Entity: *NewEntity(), + } + return m +} + +// CreateInvestigationMessageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationMessageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationMessage(), nil +} + +// GetAgentTurnId gets the agentTurnId property value. Opaque identifier of the agent-processing turn associated with this message, when available. Does not identify the overall session or run. +// returns a *string when successful +func (m *InvestigationMessage) GetAgentTurnId() *string { + val, err := m.GetBackingStore().Get("agentTurnId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetAuthor gets the author property value. Embedded message-author role and identifier, not an independently addressable resource. +// returns a InvestigationMessageAuthorable when successful +func (m *InvestigationMessage) GetAuthor() InvestigationMessageAuthorable { + val, err := m.GetBackingStore().Get("author") + if err != nil { + panic(err) + } + if val != nil { + return val.(InvestigationMessageAuthorable) + } + return nil +} + +// GetContent gets the content property value. Optional in historical transcript reads when the source omits content. +// returns a *string when successful +func (m *InvestigationMessage) GetContent() *string { + val, err := m.GetBackingStore().Get("content") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetCreatedDateTime gets the createdDateTime property value. UTC persistence timestamp. Backend wire name: timestamp. +// returns a *Time when successful +func (m *InvestigationMessage) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationMessage) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["agentTurnId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAgentTurnId(val) + } + return nil + } + res["author"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateInvestigationMessageAuthorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(InvestigationMessageAuthorable)) + } + return nil + } + res["content"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["kind"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInvestigationMessageType) + if err != nil { + return err + } + if val != nil { + m.SetKind(val.(*InvestigationMessageType)) + } + return nil + } + res["role"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInvestigationMessageRole) + if err != nil { + return err + } + if val != nil { + m.SetRole(val.(*InvestigationMessageRole)) + } + return nil + } + res["sequenceId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSequenceId(val) + } + return nil + } + return res +} + +// GetKind gets the kind property value. Read-only message categories from the existing transcript contract. +// returns a *InvestigationMessageType when successful +func (m *InvestigationMessage) GetKind() *InvestigationMessageType { + val, err := m.GetBackingStore().Get("kind") + if err != nil { + panic(err) + } + if val != nil { + return val.(*InvestigationMessageType) + } + return nil +} + +// GetRole gets the role property value. Transcript message role or recorded author kind. These are independent fields; a tool or system message can have an agent author. +// returns a *InvestigationMessageRole when successful +func (m *InvestigationMessage) GetRole() *InvestigationMessageRole { + val, err := m.GetBackingStore().Get("role") + if err != nil { + panic(err) + } + if val != nil { + return val.(*InvestigationMessageRole) + } + return nil +} + +// GetSequenceId gets the sequenceId property value. Opaque chronological sequence identifier, when available. Does not advertise Graph delta or a message-item key. +// returns a *string when successful +func (m *InvestigationMessage) GetSequenceId() *string { + val, err := m.GetBackingStore().Get("sequenceId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationMessage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + if m.GetKind() != nil { + cast := (*m.GetKind()).String() + err = writer.WriteStringValue("kind", &cast) + if err != nil { + return err + } + } + if m.GetRole() != nil { + cast := (*m.GetRole()).String() + err = writer.WriteStringValue("role", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetAgentTurnId sets the agentTurnId property value. Opaque identifier of the agent-processing turn associated with this message, when available. Does not identify the overall session or run. +func (m *InvestigationMessage) SetAgentTurnId(value *string) { + err := m.GetBackingStore().Set("agentTurnId", value) + if err != nil { + panic(err) + } +} + +// SetAuthor sets the author property value. Embedded message-author role and identifier, not an independently addressable resource. +func (m *InvestigationMessage) SetAuthor(value InvestigationMessageAuthorable) { + err := m.GetBackingStore().Set("author", value) + if err != nil { + panic(err) + } +} + +// SetContent sets the content property value. Optional in historical transcript reads when the source omits content. +func (m *InvestigationMessage) SetContent(value *string) { + err := m.GetBackingStore().Set("content", value) + if err != nil { + panic(err) + } +} + +// SetCreatedDateTime sets the createdDateTime property value. UTC persistence timestamp. Backend wire name: timestamp. +func (m *InvestigationMessage) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetKind sets the kind property value. Read-only message categories from the existing transcript contract. +func (m *InvestigationMessage) SetKind(value *InvestigationMessageType) { + err := m.GetBackingStore().Set("kind", value) + if err != nil { + panic(err) + } +} + +// SetRole sets the role property value. Transcript message role or recorded author kind. These are independent fields; a tool or system message can have an agent author. +func (m *InvestigationMessage) SetRole(value *InvestigationMessageRole) { + err := m.GetBackingStore().Set("role", value) + if err != nil { + panic(err) + } +} + +// SetSequenceId sets the sequenceId property value. Opaque chronological sequence identifier, when available. Does not advertise Graph delta or a message-item key. +func (m *InvestigationMessage) SetSequenceId(value *string) { + err := m.GetBackingStore().Set("sequenceId", value) + if err != nil { + panic(err) + } +} + +type InvestigationMessageable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAgentTurnId() *string + GetAuthor() InvestigationMessageAuthorable + GetContent() *string + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetKind() *InvestigationMessageType + GetRole() *InvestigationMessageRole + GetSequenceId() *string + SetAgentTurnId(value *string) + SetAuthor(value InvestigationMessageAuthorable) + SetContent(value *string) + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetKind(value *InvestigationMessageType) + SetRole(value *InvestigationMessageRole) + SetSequenceId(value *string) +} diff --git a/models/investigation_message_author.go b/models/investigation_message_author.go new file mode 100644 index 00000000000..9a6a46fac27 --- /dev/null +++ b/models/investigation_message_author.go @@ -0,0 +1,200 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// InvestigationMessageAuthor embedded message-author role and identifier, not an independently addressable resource. +type InvestigationMessageAuthor struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewInvestigationMessageAuthor instantiates a new InvestigationMessageAuthor and sets the default values. +func NewInvestigationMessageAuthor() *InvestigationMessageAuthor { + m := &InvestigationMessageAuthor{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateInvestigationMessageAuthorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationMessageAuthorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationMessageAuthor(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *InvestigationMessageAuthor) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *InvestigationMessageAuthor) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationMessageAuthor) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["key"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["role"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInvestigationMessageRole) + if err != nil { + return err + } + if val != nil { + m.SetRole(val.(*InvestigationMessageRole)) + } + return nil + } + return res +} + +// GetKey gets the key property value. Recorded author identifier. For a user it identifies a Microsoft Entra user; for an agent it identifies a service catalog/runtime agent, not an Entra directory object. Maps to backend id; a structural value, not an OData entity key. The source can return an empty value when no author id is recorded. +// returns a *string when successful +func (m *InvestigationMessageAuthor) GetKey() *string { + val, err := m.GetBackingStore().Get("key") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *InvestigationMessageAuthor) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetRole gets the role property value. Transcript message role or recorded author kind. These are independent fields; a tool or system message can have an agent author. +// returns a *InvestigationMessageRole when successful +func (m *InvestigationMessageAuthor) GetRole() *InvestigationMessageRole { + val, err := m.GetBackingStore().Get("role") + if err != nil { + panic(err) + } + if val != nil { + return val.(*InvestigationMessageRole) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationMessageAuthor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetRole() != nil { + cast := (*m.GetRole()).String() + err := writer.WriteStringValue("role", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *InvestigationMessageAuthor) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *InvestigationMessageAuthor) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetKey sets the key property value. Recorded author identifier. For a user it identifies a Microsoft Entra user; for an agent it identifies a service catalog/runtime agent, not an Entra directory object. Maps to backend id; a structural value, not an OData entity key. The source can return an empty value when no author id is recorded. +func (m *InvestigationMessageAuthor) SetKey(value *string) { + err := m.GetBackingStore().Set("key", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *InvestigationMessageAuthor) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetRole sets the role property value. Transcript message role or recorded author kind. These are independent fields; a tool or system message can have an agent author. +func (m *InvestigationMessageAuthor) SetRole(value *InvestigationMessageRole) { + err := m.GetBackingStore().Set("role", value) + if err != nil { + panic(err) + } +} + +type InvestigationMessageAuthorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetKey() *string + GetOdataType() *string + GetRole() *InvestigationMessageRole + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetKey(value *string) + SetOdataType(value *string) + SetRole(value *InvestigationMessageRole) +} diff --git a/models/investigation_message_collection_response.go b/models/investigation_message_collection_response.go new file mode 100644 index 00000000000..79673cedd51 --- /dev/null +++ b/models/investigation_message_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type InvestigationMessageCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewInvestigationMessageCollectionResponse instantiates a new InvestigationMessageCollectionResponse and sets the default values. +func NewInvestigationMessageCollectionResponse() *InvestigationMessageCollectionResponse { + m := &InvestigationMessageCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateInvestigationMessageCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationMessageCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationMessageCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationMessageCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationMessageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationMessageable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationMessageable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []InvestigationMessageable when successful +func (m *InvestigationMessageCollectionResponse) GetValue() []InvestigationMessageable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationMessageable) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationMessageCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *InvestigationMessageCollectionResponse) SetValue(value []InvestigationMessageable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type InvestigationMessageCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []InvestigationMessageable + SetValue(value []InvestigationMessageable) +} diff --git a/models/investigation_message_role.go b/models/investigation_message_role.go new file mode 100644 index 00000000000..9c0c4767b93 --- /dev/null +++ b/models/investigation_message_role.go @@ -0,0 +1,50 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// Transcript message role or recorded author kind. These are independent fields; a tool or system message can have an agent author. +type InvestigationMessageRole int + +const ( + USER_INVESTIGATIONMESSAGEROLE InvestigationMessageRole = iota + AGENT_INVESTIGATIONMESSAGEROLE + SYSTEM_INVESTIGATIONMESSAGEROLE + TOOL_INVESTIGATIONMESSAGEROLE + UNKNOWNFUTUREVALUE_INVESTIGATIONMESSAGEROLE +) + +func (i InvestigationMessageRole) String() string { + return []string{"user", "agent", "system", "tool", "unknownFutureValue"}[i] +} + +func ParseInvestigationMessageRole(v string) (any, error) { + result := USER_INVESTIGATIONMESSAGEROLE + switch v { + case "user": + result = USER_INVESTIGATIONMESSAGEROLE + case "agent": + result = AGENT_INVESTIGATIONMESSAGEROLE + case "system": + result = SYSTEM_INVESTIGATIONMESSAGEROLE + case "tool": + result = TOOL_INVESTIGATIONMESSAGEROLE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_INVESTIGATIONMESSAGEROLE + default: + return nil, nil + } + return &result, nil +} + +func SerializeInvestigationMessageRole(values []InvestigationMessageRole) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i InvestigationMessageRole) isMultiValue() bool { + return false +} diff --git a/models/investigation_message_type.go b/models/investigation_message_type.go new file mode 100644 index 00000000000..09a572f8ff3 --- /dev/null +++ b/models/investigation_message_type.go @@ -0,0 +1,56 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// Read-only message categories from the existing transcript contract. +type InvestigationMessageType int + +const ( + USERMESSAGE_INVESTIGATIONMESSAGETYPE InvestigationMessageType = iota + AGENTMESSAGE_INVESTIGATIONMESSAGETYPE + TOOLREQUEST_INVESTIGATIONMESSAGETYPE + TOOLOUTPUT_INVESTIGATIONMESSAGETYPE + PERMISSIONREQUEST_INVESTIGATIONMESSAGETYPE + PERMISSIONRESPONSE_INVESTIGATIONMESSAGETYPE + UNKNOWNFUTUREVALUE_INVESTIGATIONMESSAGETYPE +) + +func (i InvestigationMessageType) String() string { + return []string{"userMessage", "agentMessage", "toolRequest", "toolOutput", "permissionRequest", "permissionResponse", "unknownFutureValue"}[i] +} + +func ParseInvestigationMessageType(v string) (any, error) { + result := USERMESSAGE_INVESTIGATIONMESSAGETYPE + switch v { + case "userMessage": + result = USERMESSAGE_INVESTIGATIONMESSAGETYPE + case "agentMessage": + result = AGENTMESSAGE_INVESTIGATIONMESSAGETYPE + case "toolRequest": + result = TOOLREQUEST_INVESTIGATIONMESSAGETYPE + case "toolOutput": + result = TOOLOUTPUT_INVESTIGATIONMESSAGETYPE + case "permissionRequest": + result = PERMISSIONREQUEST_INVESTIGATIONMESSAGETYPE + case "permissionResponse": + result = PERMISSIONRESPONSE_INVESTIGATIONMESSAGETYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_INVESTIGATIONMESSAGETYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeInvestigationMessageType(values []InvestigationMessageType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i InvestigationMessageType) isMultiValue() bool { + return false +} diff --git a/models/investigation_output.go b/models/investigation_output.go new file mode 100644 index 00000000000..40533e21077 --- /dev/null +++ b/models/investigation_output.go @@ -0,0 +1,121 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InvestigationOutput a read-only stored-file output owned and contained by an investigation session. Inherited id is the existing stable opaque stored-file identifier, unique within its session. Metadata and content reads enforce the same parent-session authorization. +type InvestigationOutput struct { + Entity +} + +// NewInvestigationOutput instantiates a new InvestigationOutput and sets the default values. +func NewInvestigationOutput() *InvestigationOutput { + m := &InvestigationOutput{ + Entity: *NewEntity(), + } + return m +} + +// CreateInvestigationOutputFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationOutputFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationOutput(), nil +} + +// GetContent gets the content property value. The output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a []byte when successful +func (m *InvestigationOutput) GetContent() []byte { + val, err := m.GetBackingStore().Get("content") + if err != nil { + panic(err) + } + if val != nil { + return val.([]byte) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationOutput) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["content"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetByteArrayValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["kind"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInvestigationOutputType) + if err != nil { + return err + } + if val != nil { + m.SetKind(val.(*InvestigationOutputType)) + } + return nil + } + return res +} + +// GetKind gets the kind property value. Output category: summary text or an artifact, both retrieved through the authenticated content stream. +// returns a *InvestigationOutputType when successful +func (m *InvestigationOutput) GetKind() *InvestigationOutputType { + val, err := m.GetBackingStore().Get("kind") + if err != nil { + panic(err) + } + if val != nil { + return val.(*InvestigationOutputType) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationOutput) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetKind() != nil { + cast := (*m.GetKind()).String() + err = writer.WriteStringValue("kind", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetContent sets the content property value. The output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +func (m *InvestigationOutput) SetContent(value []byte) { + err := m.GetBackingStore().Set("content", value) + if err != nil { + panic(err) + } +} + +// SetKind sets the kind property value. Output category: summary text or an artifact, both retrieved through the authenticated content stream. +func (m *InvestigationOutput) SetKind(value *InvestigationOutputType) { + err := m.GetBackingStore().Set("kind", value) + if err != nil { + panic(err) + } +} + +type InvestigationOutputable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent() []byte + GetKind() *InvestigationOutputType + SetContent(value []byte) + SetKind(value *InvestigationOutputType) +} diff --git a/models/investigation_output_collection_response.go b/models/investigation_output_collection_response.go new file mode 100644 index 00000000000..9bb6d6ddb5b --- /dev/null +++ b/models/investigation_output_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type InvestigationOutputCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewInvestigationOutputCollectionResponse instantiates a new InvestigationOutputCollectionResponse and sets the default values. +func NewInvestigationOutputCollectionResponse() *InvestigationOutputCollectionResponse { + m := &InvestigationOutputCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateInvestigationOutputCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationOutputCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationOutputCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationOutputCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationOutputFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationOutputable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationOutputable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []InvestigationOutputable when successful +func (m *InvestigationOutputCollectionResponse) GetValue() []InvestigationOutputable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationOutputable) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationOutputCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *InvestigationOutputCollectionResponse) SetValue(value []InvestigationOutputable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type InvestigationOutputCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []InvestigationOutputable + SetValue(value []InvestigationOutputable) +} diff --git a/models/investigation_output_type.go b/models/investigation_output_type.go new file mode 100644 index 00000000000..230e429154f --- /dev/null +++ b/models/investigation_output_type.go @@ -0,0 +1,44 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +// Output category: summary text or an artifact, both retrieved through the authenticated content stream. +type InvestigationOutputType int + +const ( + SUMMARY_INVESTIGATIONOUTPUTTYPE InvestigationOutputType = iota + ARTIFACT_INVESTIGATIONOUTPUTTYPE + UNKNOWNFUTUREVALUE_INVESTIGATIONOUTPUTTYPE +) + +func (i InvestigationOutputType) String() string { + return []string{"summary", "artifact", "unknownFutureValue"}[i] +} + +func ParseInvestigationOutputType(v string) (any, error) { + result := SUMMARY_INVESTIGATIONOUTPUTTYPE + switch v { + case "summary": + result = SUMMARY_INVESTIGATIONOUTPUTTYPE + case "artifact": + result = ARTIFACT_INVESTIGATIONOUTPUTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_INVESTIGATIONOUTPUTTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeInvestigationOutputType(values []InvestigationOutputType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i InvestigationOutputType) isMultiValue() bool { + return false +} diff --git a/models/investigation_session.go b/models/investigation_session.go new file mode 100644 index 00000000000..d2cc9910cf3 --- /dev/null +++ b/models/investigation_session.go @@ -0,0 +1,536 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// InvestigationSession one playbook execution against typed external inputs. Server-owned status records processing; this resource is the polling target. +type InvestigationSession struct { + Entity +} + +// NewInvestigationSession instantiates a new InvestigationSession and sets the default values. +func NewInvestigationSession() *InvestigationSession { + m := &InvestigationSession{ + Entity: *NewEntity(), + } + return m +} + +// CreateInvestigationSessionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationSessionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationSession(), nil +} + +// GetAgentRuns gets the agentRuns property value. The read-only agent runs owned by this session. Supports list and keyed GET with $select and server-driven paging. +// returns a []AgentRunable when successful +func (m *InvestigationSession) GetAgentRuns() []AgentRunable { + val, err := m.GetBackingStore().Get("agentRuns") + if err != nil { + panic(err) + } + if val != nil { + return val.([]AgentRunable) + } + return nil +} + +// GetCreatedDateTime gets the createdDateTime property value. The UTC date and time when the resource was created, in ISO 8601 format. Read-only. +// returns a *Time when successful +func (m *InvestigationSession) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDisplayName gets the displayName property value. The session name generated by the service. Read-only. +// returns a *string when successful +func (m *InvestigationSession) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationSession) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["agentRuns"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAgentRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AgentRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AgentRunable) + } + } + m.SetAgentRuns(res) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["initiatedBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateInvestigationIdentitySetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInitiatedBy(val.(InvestigationIdentitySetable)) + } + return nil + } + res["inputs"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationInputFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationInputable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationInputable) + } + } + m.SetInputs(res) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["messages"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationMessageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationMessageable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationMessageable) + } + } + m.SetMessages(res) + } + return nil + } + res["outputs"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationOutputFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationOutputable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationOutputable) + } + } + m.SetOutputs(res) + } + return nil + } + res["playbookDefinition"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePlaybookDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlaybookDefinition(val.(PlaybookDefinitionable)) + } + return nil + } + res["status"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseLongRunningOperationStatus) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*LongRunningOperationStatus)) + } + return nil + } + res["statusDetail"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusDetail(val) + } + return nil + } + res["tags"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetTags(res) + } + return nil + } + return res +} + +// GetInitiatedBy gets the initiatedBy property value. The initiating principals recorded by the service, when available. Read-only. This property doesn't select an execution identity. +// returns a InvestigationIdentitySetable when successful +func (m *InvestigationSession) GetInitiatedBy() InvestigationIdentitySetable { + val, err := m.GetBackingStore().Get("initiatedBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(InvestigationIdentitySetable) + } + return nil +} + +// GetInputs gets the inputs property value. The input references contained by the session. Required inline array on session creation; it can be empty if the playbook permits it. Each new input accepts only kind and value. After creation, supports only list and keyed GET with $select and server-driven paging. +// returns a []InvestigationInputable when successful +func (m *InvestigationSession) GetInputs() []InvestigationInputable { + val, err := m.GetBackingStore().Get("inputs") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationInputable) + } + return nil +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The UTC date and time when the resource was last updated, in ISO 8601 format. Read-only. +// returns a *Time when successful +func (m *InvestigationSession) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetMessages gets the messages property value. Read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +// returns a []InvestigationMessageable when successful +func (m *InvestigationSession) GetMessages() []InvestigationMessageable { + val, err := m.GetBackingStore().Get("messages") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationMessageable) + } + return nil +} + +// GetOutputs gets the outputs property value. The read-only stored-file outputs owned by this session. Supports list and keyed GET with $select, server-driven paging, and authenticated content downloads. +// returns a []InvestigationOutputable when successful +func (m *InvestigationSession) GetOutputs() []InvestigationOutputable { + val, err := m.GetBackingStore().Get("outputs") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationOutputable) + } + return nil +} + +// GetPlaybookDefinition gets the playbookDefinition property value. The playbookDefinition property +// returns a PlaybookDefinitionable when successful +func (m *InvestigationSession) GetPlaybookDefinition() PlaybookDefinitionable { + val, err := m.GetBackingStore().Get("playbookDefinition") + if err != nil { + panic(err) + } + if val != nil { + return val.(PlaybookDefinitionable) + } + return nil +} + +// GetStatus gets the status property value. The status property +// returns a *LongRunningOperationStatus when successful +func (m *InvestigationSession) GetStatus() *LongRunningOperationStatus { + val, err := m.GetBackingStore().Get("status") + if err != nil { + panic(err) + } + if val != nil { + return val.(*LongRunningOperationStatus) + } + return nil +} + +// GetStatusDetail gets the statusDetail property value. Additional processing detail, including waitingForInput or stopped, when the status alone doesn't describe the source lifecycle. Read-only. Doesn't support $filter. For the session lifecycle combinations, see Get agentic session. +// returns a *string when successful +func (m *InvestigationSession) GetStatusDetail() *string { + val, err := m.GetBackingStore().Get("statusDetail") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTags gets the tags property value. The service-generated tags for the session. Read-only. Can't be supplied when creating a session. +// returns a []string when successful +func (m *InvestigationSession) GetTags() []string { + val, err := m.GetBackingStore().Get("tags") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationSession) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetAgentRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAgentRuns())) + for i, v := range m.GetAgentRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("agentRuns", cast) + if err != nil { + return err + } + } + if m.GetInputs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetInputs())) + for i, v := range m.GetInputs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("inputs", cast) + if err != nil { + return err + } + } + if m.GetMessages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMessages())) + for i, v := range m.GetMessages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("messages", cast) + if err != nil { + return err + } + } + if m.GetOutputs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetOutputs())) + for i, v := range m.GetOutputs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("outputs", cast) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("playbookDefinition", m.GetPlaybookDefinition()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err = writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + return nil +} + +// SetAgentRuns sets the agentRuns property value. The read-only agent runs owned by this session. Supports list and keyed GET with $select and server-driven paging. +func (m *InvestigationSession) SetAgentRuns(value []AgentRunable) { + err := m.GetBackingStore().Set("agentRuns", value) + if err != nil { + panic(err) + } +} + +// SetCreatedDateTime sets the createdDateTime property value. The UTC date and time when the resource was created, in ISO 8601 format. Read-only. +func (m *InvestigationSession) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. The session name generated by the service. Read-only. +func (m *InvestigationSession) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetInitiatedBy sets the initiatedBy property value. The initiating principals recorded by the service, when available. Read-only. This property doesn't select an execution identity. +func (m *InvestigationSession) SetInitiatedBy(value InvestigationIdentitySetable) { + err := m.GetBackingStore().Set("initiatedBy", value) + if err != nil { + panic(err) + } +} + +// SetInputs sets the inputs property value. The input references contained by the session. Required inline array on session creation; it can be empty if the playbook permits it. Each new input accepts only kind and value. After creation, supports only list and keyed GET with $select and server-driven paging. +func (m *InvestigationSession) SetInputs(value []InvestigationInputable) { + err := m.GetBackingStore().Set("inputs", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The UTC date and time when the resource was last updated, in ISO 8601 format. Read-only. +func (m *InvestigationSession) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetMessages sets the messages property value. Read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +func (m *InvestigationSession) SetMessages(value []InvestigationMessageable) { + err := m.GetBackingStore().Set("messages", value) + if err != nil { + panic(err) + } +} + +// SetOutputs sets the outputs property value. The read-only stored-file outputs owned by this session. Supports list and keyed GET with $select, server-driven paging, and authenticated content downloads. +func (m *InvestigationSession) SetOutputs(value []InvestigationOutputable) { + err := m.GetBackingStore().Set("outputs", value) + if err != nil { + panic(err) + } +} + +// SetPlaybookDefinition sets the playbookDefinition property value. The playbookDefinition property +func (m *InvestigationSession) SetPlaybookDefinition(value PlaybookDefinitionable) { + err := m.GetBackingStore().Set("playbookDefinition", value) + if err != nil { + panic(err) + } +} + +// SetStatus sets the status property value. The status property +func (m *InvestigationSession) SetStatus(value *LongRunningOperationStatus) { + err := m.GetBackingStore().Set("status", value) + if err != nil { + panic(err) + } +} + +// SetStatusDetail sets the statusDetail property value. Additional processing detail, including waitingForInput or stopped, when the status alone doesn't describe the source lifecycle. Read-only. Doesn't support $filter. For the session lifecycle combinations, see Get agentic session. +func (m *InvestigationSession) SetStatusDetail(value *string) { + err := m.GetBackingStore().Set("statusDetail", value) + if err != nil { + panic(err) + } +} + +// SetTags sets the tags property value. The service-generated tags for the session. Read-only. Can't be supplied when creating a session. +func (m *InvestigationSession) SetTags(value []string) { + err := m.GetBackingStore().Set("tags", value) + if err != nil { + panic(err) + } +} + +type InvestigationSessionable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAgentRuns() []AgentRunable + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDisplayName() *string + GetInitiatedBy() InvestigationIdentitySetable + GetInputs() []InvestigationInputable + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetMessages() []InvestigationMessageable + GetOutputs() []InvestigationOutputable + GetPlaybookDefinition() PlaybookDefinitionable + GetStatus() *LongRunningOperationStatus + GetStatusDetail() *string + GetTags() []string + SetAgentRuns(value []AgentRunable) + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDisplayName(value *string) + SetInitiatedBy(value InvestigationIdentitySetable) + SetInputs(value []InvestigationInputable) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetMessages(value []InvestigationMessageable) + SetOutputs(value []InvestigationOutputable) + SetPlaybookDefinition(value PlaybookDefinitionable) + SetStatus(value *LongRunningOperationStatus) + SetStatusDetail(value *string) + SetTags(value []string) +} diff --git a/models/investigation_session_collection_response.go b/models/investigation_session_collection_response.go new file mode 100644 index 00000000000..7070b56f407 --- /dev/null +++ b/models/investigation_session_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type InvestigationSessionCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewInvestigationSessionCollectionResponse instantiates a new InvestigationSessionCollectionResponse and sets the default values. +func NewInvestigationSessionCollectionResponse() *InvestigationSessionCollectionResponse { + m := &InvestigationSessionCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateInvestigationSessionCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInvestigationSessionCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInvestigationSessionCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *InvestigationSessionCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateInvestigationSessionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationSessionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(InvestigationSessionable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []InvestigationSessionable when successful +func (m *InvestigationSessionCollectionResponse) GetValue() []InvestigationSessionable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationSessionable) + } + return nil +} + +// Serialize serializes information the current object +func (m *InvestigationSessionCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *InvestigationSessionCollectionResponse) SetValue(value []InvestigationSessionable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type InvestigationSessionCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []InvestigationSessionable + SetValue(value []InvestigationSessionable) +} diff --git a/models/organization.go b/models/organization.go index 0de7f48009f..31cf83ada3f 100644 --- a/models/organization.go +++ b/models/organization.go @@ -766,7 +766,7 @@ func (m *Organization) GetProvisionedPlans() []ProvisionedPlanable { return nil } -// GetResourceQuotas gets the resourceQuotas property value. The resourceQuotas property +// GetResourceQuotas gets the resourceQuotas property value. The quota configurations for resource types in the organization. Each resourceType value must be unique in the collection. The maxPercentage value represents the maximum percentage of directorySizeQuota.total that the resource type can consume, from 0 to 100. A value of 0 blocks creation of new resources of that type. // returns a []ResourceQuotaable when successful func (m *Organization) GetResourceQuotas() []ResourceQuotaable { val, err := m.GetBackingStore().Get("resourceQuotas") @@ -1334,7 +1334,7 @@ func (m *Organization) SetProvisionedPlans(value []ProvisionedPlanable) { } } -// SetResourceQuotas sets the resourceQuotas property value. The resourceQuotas property +// SetResourceQuotas sets the resourceQuotas property value. The quota configurations for resource types in the organization. Each resourceType value must be unique in the collection. The maxPercentage value represents the maximum percentage of directorySizeQuota.total that the resource type can consume, from 0 to 100. A value of 0 blocks creation of new resources of that type. func (m *Organization) SetResourceQuotas(value []ResourceQuotaable) { err := m.GetBackingStore().Set("resourceQuotas", value) if err != nil { diff --git a/models/plan.go b/models/plan.go index d5ad7d60fa1..1708672bafc 100644 --- a/models/plan.go +++ b/models/plan.go @@ -26,7 +26,7 @@ func CreatePlanFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487ee return NewPlan(), nil } -// GetArchivalInfo gets the archivalInfo property value. Information about whether the entity is archived, and when it was archived. +// GetArchivalInfo gets the archivalInfo property value. Service-populated information about whether the entity is archived, and when it was archived. Read-only. // returns a PlannerArchivalInfoable when successful func (m *Plan) GetArchivalInfo() PlannerArchivalInfoable { val, err := m.GetBackingStore().Get("archivalInfo") @@ -104,7 +104,7 @@ func (m *Plan) GetContentSensitivityLabelAssignment() ContentSensitivityLabelAss return nil } -// GetContexts gets the contexts property value. The collection of context links describing where the plan is surfaced. Read-only. Nullable. +// GetContexts gets the contexts property value. Context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a []PlanContextLinkable when successful func (m *Plan) GetContexts() []PlanContextLinkable { val, err := m.GetBackingStore().Get("contexts") @@ -169,7 +169,7 @@ func (m *Plan) GetDisplayName() *string { return nil } -// GetDuration gets the duration property value. Duration of the plan, in days. +// GetDuration gets the duration property value. Computed duration of the plan, in seconds. Read-only. // returns a *int32 when successful func (m *Plan) GetDuration() *int32 { val, err := m.GetBackingStore().Get("duration") @@ -489,7 +489,7 @@ func (m *Plan) GetGoals() []Goalable { return nil } -// GetHasChat gets the hasChat property value. Indicates whether the plan has an associated chat. +// GetHasChat gets the hasChat property value. Indicates whether the plan has an associated chat. Read-only. // returns a *bool when successful func (m *Plan) GetHasChat() *bool { val, err := m.GetBackingStore().Get("hasChat") @@ -541,7 +541,7 @@ func (m *Plan) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f30 return nil } -// GetLinks gets the links property value. The collection of content links attached to the plan. Read-only. Nullable. +// GetLinks gets the links property value. Content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a []ContentLinkable when successful func (m *Plan) GetLinks() []ContentLinkable { val, err := m.GetBackingStore().Get("links") @@ -776,7 +776,7 @@ func (m *Plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c49 return nil } -// SetArchivalInfo sets the archivalInfo property value. Information about whether the entity is archived, and when it was archived. +// SetArchivalInfo sets the archivalInfo property value. Service-populated information about whether the entity is archived, and when it was archived. Read-only. func (m *Plan) SetArchivalInfo(value PlannerArchivalInfoable) { err := m.GetBackingStore().Set("archivalInfo", value) if err != nil { @@ -824,7 +824,7 @@ func (m *Plan) SetContentSensitivityLabelAssignment(value ContentSensitivityLabe } } -// SetContexts sets the contexts property value. The collection of context links describing where the plan is surfaced. Read-only. Nullable. +// SetContexts sets the contexts property value. Context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. func (m *Plan) SetContexts(value []PlanContextLinkable) { err := m.GetBackingStore().Set("contexts", value) if err != nil { @@ -864,7 +864,7 @@ func (m *Plan) SetDisplayName(value *string) { } } -// SetDuration sets the duration property value. Duration of the plan, in days. +// SetDuration sets the duration property value. Computed duration of the plan, in seconds. Read-only. func (m *Plan) SetDuration(value *int32) { err := m.GetBackingStore().Set("duration", value) if err != nil { @@ -888,7 +888,7 @@ func (m *Plan) SetGoals(value []Goalable) { } } -// SetHasChat sets the hasChat property value. Indicates whether the plan has an associated chat. +// SetHasChat sets the hasChat property value. Indicates whether the plan has an associated chat. Read-only. func (m *Plan) SetHasChat(value *bool) { err := m.GetBackingStore().Set("hasChat", value) if err != nil { @@ -920,7 +920,7 @@ func (m *Plan) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a } } -// SetLinks sets the links property value. The collection of content links attached to the plan. Read-only. Nullable. +// SetLinks sets the links property value. Content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. func (m *Plan) SetLinks(value []ContentLinkable) { err := m.GetBackingStore().Set("links", value) if err != nil { diff --git a/models/plan_context_link.go b/models/plan_context_link.go index 3fc04ed07b5..e7ebc341dc7 100644 --- a/models/plan_context_link.go +++ b/models/plan_context_link.go @@ -217,7 +217,7 @@ func (m *PlanContextLink) GetIsActive() *bool { return nil } -// GetIsCreation gets the isCreation property value. Indicates whether this context link represents the original creation surface for the plan. +// GetIsCreation gets the isCreation property value. Indicates whether this context link represents the original creation surface for the plan. Service-populated. Read-only. // returns a *bool when successful func (m *PlanContextLink) GetIsCreation() *bool { val, err := m.GetBackingStore().Get("isCreation") @@ -230,7 +230,7 @@ func (m *PlanContextLink) GetIsCreation() *bool { return nil } -// GetKey gets the key property value. Identifier for the context the plan is surfaced in. +// GetKey gets the key property value. Client-specified identifier for the context the plan is surfaced in. Immutable after creation. // returns a *string when successful func (m *PlanContextLink) GetKey() *string { val, err := m.GetBackingStore().Get("key") @@ -243,7 +243,7 @@ func (m *PlanContextLink) GetKey() *string { return nil } -// GetOwnerAppId gets the ownerAppId property value. Application ID of the app that owns the surface the plan is linked from. +// GetOwnerAppId gets the ownerAppId property value. Application ID of the app that owns the surface the plan is linked from. Service-populated. Read-only. // returns a *string when successful func (m *PlanContextLink) GetOwnerAppId() *string { val, err := m.GetBackingStore().Get("ownerAppId") @@ -381,7 +381,7 @@ func (m *PlanContextLink) SetIsActive(value *bool) { } } -// SetIsCreation sets the isCreation property value. Indicates whether this context link represents the original creation surface for the plan. +// SetIsCreation sets the isCreation property value. Indicates whether this context link represents the original creation surface for the plan. Service-populated. Read-only. func (m *PlanContextLink) SetIsCreation(value *bool) { err := m.GetBackingStore().Set("isCreation", value) if err != nil { @@ -389,7 +389,7 @@ func (m *PlanContextLink) SetIsCreation(value *bool) { } } -// SetKey sets the key property value. Identifier for the context the plan is surfaced in. +// SetKey sets the key property value. Client-specified identifier for the context the plan is surfaced in. Immutable after creation. func (m *PlanContextLink) SetKey(value *string) { err := m.GetBackingStore().Set("key", value) if err != nil { @@ -397,7 +397,7 @@ func (m *PlanContextLink) SetKey(value *string) { } } -// SetOwnerAppId sets the ownerAppId property value. Application ID of the app that owns the surface the plan is linked from. +// SetOwnerAppId sets the ownerAppId property value. Application ID of the app that owns the surface the plan is linked from. Service-populated. Read-only. func (m *PlanContextLink) SetOwnerAppId(value *string) { err := m.GetBackingStore().Set("ownerAppId", value) if err != nil { diff --git a/models/planner.go b/models/planner.go index c8564556139..9c6d5320765 100644 --- a/models/planner.go +++ b/models/planner.go @@ -183,7 +183,7 @@ func (m *Planner) GetPlans() []PlannerPlanable { return nil } -// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans. +// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API. // returns a []Planable when successful func (m *Planner) GetPlansV2() []Planable { val, err := m.GetBackingStore().Get("plans_v2") @@ -222,7 +222,7 @@ func (m *Planner) GetTasks() []PlannerTaskable { return nil } -// GetTasksV2 gets the tasks_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 tasks. +// GetTasksV2 gets the tasks_v2 property value. Read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API. // returns a []Taskable when successful func (m *Planner) GetTasksV2() []Taskable { val, err := m.GetBackingStore().Get("tasks_v2") @@ -352,7 +352,7 @@ func (m *Planner) SetPlans(value []PlannerPlanable) { } } -// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans. +// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API. func (m *Planner) SetPlansV2(value []Planable) { err := m.GetBackingStore().Set("plans_v2", value) if err != nil { @@ -376,7 +376,7 @@ func (m *Planner) SetTasks(value []PlannerTaskable) { } } -// SetTasksV2 sets the tasks_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 tasks. +// SetTasksV2 sets the tasks_v2 property value. Read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API. func (m *Planner) SetTasksV2(value []Taskable) { err := m.GetBackingStore().Set("tasks_v2", value) if err != nil { diff --git a/models/planner_group.go b/models/planner_group.go index 6b03419ae1a..6e5e6eda3a6 100644 --- a/models/planner_group.go +++ b/models/planner_group.go @@ -77,7 +77,7 @@ func (m *PlannerGroup) GetPlans() []PlannerPlanable { return nil } -// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans owned by the group. +// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the group. // returns a []Planable when successful func (m *PlannerGroup) GetPlansV2() []Planable { val, err := m.GetBackingStore().Get("plans_v2") @@ -131,7 +131,7 @@ func (m *PlannerGroup) SetPlans(value []PlannerPlanable) { } } -// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans owned by the group. +// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the group. func (m *PlannerGroup) SetPlansV2(value []Planable) { err := m.GetBackingStore().Set("plans_v2", value) if err != nil { diff --git a/models/planner_user.go b/models/planner_user.go index ccc08796ae0..4f54944f011 100644 --- a/models/planner_user.go +++ b/models/planner_user.go @@ -261,7 +261,7 @@ func (m *PlannerUser) GetPlans() []PlannerPlanable { return nil } -// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans associated with the user. +// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API associated with the user. // returns a []Planable when successful func (m *PlannerUser) GetPlansV2() []Planable { val, err := m.GetBackingStore().Get("plans_v2") @@ -326,7 +326,7 @@ func (m *PlannerUser) GetTasks() []PlannerTaskable { return nil } -// GetTasksV2 gets the tasks_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 tasks assigned to the user. +// GetTasksV2 gets the tasks_v2 property value. Read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API assigned to the user. // returns a []Taskable when successful func (m *PlannerUser) GetTasksV2() []Taskable { val, err := m.GetBackingStore().Get("tasks_v2") @@ -508,7 +508,7 @@ func (m *PlannerUser) SetPlans(value []PlannerPlanable) { } } -// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans associated with the user. +// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API associated with the user. func (m *PlannerUser) SetPlansV2(value []Planable) { err := m.GetBackingStore().Set("plans_v2", value) if err != nil { @@ -548,7 +548,7 @@ func (m *PlannerUser) SetTasks(value []PlannerTaskable) { } } -// SetTasksV2 sets the tasks_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 tasks assigned to the user. +// SetTasksV2 sets the tasks_v2 property value. Read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API assigned to the user. func (m *PlannerUser) SetTasksV2(value []Taskable) { err := m.GetBackingStore().Set("tasks_v2", value) if err != nil { diff --git a/models/playbook_definition.go b/models/playbook_definition.go new file mode 100644 index 00000000000..47b47691de1 --- /dev/null +++ b/models/playbook_definition.go @@ -0,0 +1,192 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PlaybookDefinition a predefined playbook available to the caller. id is a service-generated, persisted GUID string; uniqueName preserves its backend catalog name. Sessions reference this first-class catalog entity through playbookDefinition@odata.bind. +type PlaybookDefinition struct { + Entity +} + +// NewPlaybookDefinition instantiates a new PlaybookDefinition and sets the default values. +func NewPlaybookDefinition() *PlaybookDefinition { + m := &PlaybookDefinition{ + Entity: *NewEntity(), + } + return m +} + +// CreatePlaybookDefinitionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePlaybookDefinitionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPlaybookDefinition(), nil +} + +// GetAcceptedInputTypes gets the acceptedInputTypes property value. The input kinds accepted by this playbook. The possible values are: defenderIncidentId, defenderAlertId, defenderThreatIntelligenceId, azureSubscriptionId, azureIdentityId, keyword, unknownFutureValue. unknownFutureValue isn't a valid value when creating a session. Read-only. +// returns a []InvestigationInputType when successful +func (m *PlaybookDefinition) GetAcceptedInputTypes() []InvestigationInputType { + val, err := m.GetBackingStore().Get("acceptedInputTypes") + if err != nil { + panic(err) + } + if val != nil { + return val.([]InvestigationInputType) + } + return nil +} + +// GetDescription gets the description property value. The description of the work performed by the playbook. Read-only. +// returns a *string when successful +func (m *PlaybookDefinition) GetDescription() *string { + val, err := m.GetBackingStore().Get("description") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayName gets the displayName property value. The human-readable name of the playbook. Read-only. +// returns a *string when successful +func (m *PlaybookDefinition) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PlaybookDefinition) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["acceptedInputTypes"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseInvestigationInputType) + if err != nil { + return err + } + if val != nil { + res := make([]InvestigationInputType, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*InvestigationInputType)) + } + } + m.SetAcceptedInputTypes(res) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["uniqueName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUniqueName(val) + } + return nil + } + return res +} + +// GetUniqueName gets the uniqueName property value. The immutable, unique catalog name, such as investigate-incident. Distinct from id. Alternate-key addressing isn't supported. Read-only. +// returns a *string when successful +func (m *PlaybookDefinition) GetUniqueName() *string { + val, err := m.GetBackingStore().Get("uniqueName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PlaybookDefinition) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("uniqueName", m.GetUniqueName()) + if err != nil { + return err + } + } + return nil +} + +// SetAcceptedInputTypes sets the acceptedInputTypes property value. The input kinds accepted by this playbook. The possible values are: defenderIncidentId, defenderAlertId, defenderThreatIntelligenceId, azureSubscriptionId, azureIdentityId, keyword, unknownFutureValue. unknownFutureValue isn't a valid value when creating a session. Read-only. +func (m *PlaybookDefinition) SetAcceptedInputTypes(value []InvestigationInputType) { + err := m.GetBackingStore().Set("acceptedInputTypes", value) + if err != nil { + panic(err) + } +} + +// SetDescription sets the description property value. The description of the work performed by the playbook. Read-only. +func (m *PlaybookDefinition) SetDescription(value *string) { + err := m.GetBackingStore().Set("description", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. The human-readable name of the playbook. Read-only. +func (m *PlaybookDefinition) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetUniqueName sets the uniqueName property value. The immutable, unique catalog name, such as investigate-incident. Distinct from id. Alternate-key addressing isn't supported. Read-only. +func (m *PlaybookDefinition) SetUniqueName(value *string) { + err := m.GetBackingStore().Set("uniqueName", value) + if err != nil { + panic(err) + } +} + +type PlaybookDefinitionable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAcceptedInputTypes() []InvestigationInputType + GetDescription() *string + GetDisplayName() *string + GetUniqueName() *string + SetAcceptedInputTypes(value []InvestigationInputType) + SetDescription(value *string) + SetDisplayName(value *string) + SetUniqueName(value *string) +} diff --git a/models/playbook_definition_collection_response.go b/models/playbook_definition_collection_response.go new file mode 100644 index 00000000000..01e366324fd --- /dev/null +++ b/models/playbook_definition_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PlaybookDefinitionCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewPlaybookDefinitionCollectionResponse instantiates a new PlaybookDefinitionCollectionResponse and sets the default values. +func NewPlaybookDefinitionCollectionResponse() *PlaybookDefinitionCollectionResponse { + m := &PlaybookDefinitionCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreatePlaybookDefinitionCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePlaybookDefinitionCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPlaybookDefinitionCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PlaybookDefinitionCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePlaybookDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PlaybookDefinitionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PlaybookDefinitionable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []PlaybookDefinitionable when successful +func (m *PlaybookDefinitionCollectionResponse) GetValue() []PlaybookDefinitionable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]PlaybookDefinitionable) + } + return nil +} + +// Serialize serializes information the current object +func (m *PlaybookDefinitionCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *PlaybookDefinitionCollectionResponse) SetValue(value []PlaybookDefinitionable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type PlaybookDefinitionCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []PlaybookDefinitionable + SetValue(value []PlaybookDefinitionable) +} diff --git a/models/policies_evaluation_detail.go b/models/policies_evaluation_detail.go new file mode 100644 index 00000000000..5e1d44039c8 --- /dev/null +++ b/models/policies_evaluation_detail.go @@ -0,0 +1,337 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type PoliciesEvaluationDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewPoliciesEvaluationDetail instantiates a new PoliciesEvaluationDetail and sets the default values. +func NewPoliciesEvaluationDetail() *PoliciesEvaluationDetail { + m := &PoliciesEvaluationDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreatePoliciesEvaluationDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePoliciesEvaluationDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPoliciesEvaluationDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PoliciesEvaluationDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAppliedPolicyEffects gets the appliedPolicyEffects property value. The appliedPolicyEffects property +// returns a *PolicyEffects when successful +func (m *PoliciesEvaluationDetail) GetAppliedPolicyEffects() *PolicyEffects { + val, err := m.GetBackingStore().Get("appliedPolicyEffects") + if err != nil { + panic(err) + } + if val != nil { + return val.(*PolicyEffects) + } + return nil +} + +// GetAssignedPolicyDisplayName gets the assignedPolicyDisplayName property value. The assignedPolicyDisplayName property +// returns a *string when successful +func (m *PoliciesEvaluationDetail) GetAssignedPolicyDisplayName() *string { + val, err := m.GetBackingStore().Get("assignedPolicyDisplayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetAssignmentUniqueName gets the assignmentUniqueName property value. The assignmentUniqueName property +// returns a *string when successful +func (m *PoliciesEvaluationDetail) GetAssignmentUniqueName() *string { + val, err := m.GetBackingStore().Get("assignmentUniqueName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *PoliciesEvaluationDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetEnforcementMode gets the enforcementMode property value. The enforcementMode property +// returns a *EnforcementMode when successful +func (m *PoliciesEvaluationDetail) GetEnforcementMode() *EnforcementMode { + val, err := m.GetBackingStore().Get("enforcementMode") + if err != nil { + panic(err) + } + if val != nil { + return val.(*EnforcementMode) + } + return nil +} + +// GetErrorDetails gets the errorDetails property value. The errorDetails property +// returns a PolicyEvaluationErrorDetailable when successful +func (m *PoliciesEvaluationDetail) GetErrorDetails() PolicyEvaluationErrorDetailable { + val, err := m.GetBackingStore().Get("errorDetails") + if err != nil { + panic(err) + } + if val != nil { + return val.(PolicyEvaluationErrorDetailable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PoliciesEvaluationDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["appliedPolicyEffects"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePolicyEffects) + if err != nil { + return err + } + if val != nil { + m.SetAppliedPolicyEffects(val.(*PolicyEffects)) + } + return nil + } + res["assignedPolicyDisplayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignedPolicyDisplayName(val) + } + return nil + } + res["assignmentUniqueName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignmentUniqueName(val) + } + return nil + } + res["enforcementMode"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnforcementMode) + if err != nil { + return err + } + if val != nil { + m.SetEnforcementMode(val.(*EnforcementMode)) + } + return nil + } + res["errorDetails"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePolicyEvaluationErrorDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetErrorDetails(val.(PolicyEvaluationErrorDetailable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["reasons"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetReasons(res) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *PoliciesEvaluationDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetReasons gets the reasons property value. The reasons property +// returns a []string when successful +func (m *PoliciesEvaluationDetail) GetReasons() []string { + val, err := m.GetBackingStore().Get("reasons") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PoliciesEvaluationDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetAppliedPolicyEffects() != nil { + cast := (*m.GetAppliedPolicyEffects()).String() + err := writer.WriteStringValue("appliedPolicyEffects", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PoliciesEvaluationDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAppliedPolicyEffects sets the appliedPolicyEffects property value. The appliedPolicyEffects property +func (m *PoliciesEvaluationDetail) SetAppliedPolicyEffects(value *PolicyEffects) { + err := m.GetBackingStore().Set("appliedPolicyEffects", value) + if err != nil { + panic(err) + } +} + +// SetAssignedPolicyDisplayName sets the assignedPolicyDisplayName property value. The assignedPolicyDisplayName property +func (m *PoliciesEvaluationDetail) SetAssignedPolicyDisplayName(value *string) { + err := m.GetBackingStore().Set("assignedPolicyDisplayName", value) + if err != nil { + panic(err) + } +} + +// SetAssignmentUniqueName sets the assignmentUniqueName property value. The assignmentUniqueName property +func (m *PoliciesEvaluationDetail) SetAssignmentUniqueName(value *string) { + err := m.GetBackingStore().Set("assignmentUniqueName", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *PoliciesEvaluationDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetEnforcementMode sets the enforcementMode property value. The enforcementMode property +func (m *PoliciesEvaluationDetail) SetEnforcementMode(value *EnforcementMode) { + err := m.GetBackingStore().Set("enforcementMode", value) + if err != nil { + panic(err) + } +} + +// SetErrorDetails sets the errorDetails property value. The errorDetails property +func (m *PoliciesEvaluationDetail) SetErrorDetails(value PolicyEvaluationErrorDetailable) { + err := m.GetBackingStore().Set("errorDetails", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PoliciesEvaluationDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetReasons sets the reasons property value. The reasons property +func (m *PoliciesEvaluationDetail) SetReasons(value []string) { + err := m.GetBackingStore().Set("reasons", value) + if err != nil { + panic(err) + } +} + +type PoliciesEvaluationDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppliedPolicyEffects() *PolicyEffects + GetAssignedPolicyDisplayName() *string + GetAssignmentUniqueName() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetEnforcementMode() *EnforcementMode + GetErrorDetails() PolicyEvaluationErrorDetailable + GetOdataType() *string + GetReasons() []string + SetAppliedPolicyEffects(value *PolicyEffects) + SetAssignedPolicyDisplayName(value *string) + SetAssignmentUniqueName(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetEnforcementMode(value *EnforcementMode) + SetErrorDetails(value PolicyEvaluationErrorDetailable) + SetOdataType(value *string) + SetReasons(value []string) +} diff --git a/models/policies_evaluation_result.go b/models/policies_evaluation_result.go new file mode 100644 index 00000000000..d3ec89e5d3f --- /dev/null +++ b/models/policies_evaluation_result.go @@ -0,0 +1,377 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type PoliciesEvaluationResult struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewPoliciesEvaluationResult instantiates a new PoliciesEvaluationResult and sets the default values. +func NewPoliciesEvaluationResult() *PoliciesEvaluationResult { + m := &PoliciesEvaluationResult{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreatePoliciesEvaluationResultFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePoliciesEvaluationResultFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPoliciesEvaluationResult(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PoliciesEvaluationResult) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAppliedPoliciesEffects gets the appliedPoliciesEffects property value. The appliedPoliciesEffects property +// returns a *PolicyEffects when successful +func (m *PoliciesEvaluationResult) GetAppliedPoliciesEffects() *PolicyEffects { + val, err := m.GetBackingStore().Get("appliedPoliciesEffects") + if err != nil { + panic(err) + } + if val != nil { + return val.(*PolicyEffects) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *PoliciesEvaluationResult) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDetails gets the details property value. The details property +// returns a []PoliciesEvaluationDetailable when successful +func (m *PoliciesEvaluationResult) GetDetails() []PoliciesEvaluationDetailable { + val, err := m.GetBackingStore().Get("details") + if err != nil { + panic(err) + } + if val != nil { + return val.([]PoliciesEvaluationDetailable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PoliciesEvaluationResult) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["appliedPoliciesEffects"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePolicyEffects) + if err != nil { + return err + } + if val != nil { + m.SetAppliedPoliciesEffects(val.(*PolicyEffects)) + } + return nil + } + res["details"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePoliciesEvaluationDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PoliciesEvaluationDetailable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PoliciesEvaluationDetailable) + } + } + m.SetDetails(res) + } + return nil + } + res["httpMethod"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRequestHttpMethod) + if err != nil { + return err + } + if val != nil { + m.SetHttpMethod(val.(*RequestHttpMethod)) + } + return nil + } + res["isBlocked"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsBlocked(val) + } + return nil + } + res["message"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["normalizedRequestInput"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetNormalizedRequestInput(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["resourceUri"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResourceUri(val) + } + return nil + } + return res +} + +// GetHttpMethod gets the httpMethod property value. The httpMethod property +// returns a *RequestHttpMethod when successful +func (m *PoliciesEvaluationResult) GetHttpMethod() *RequestHttpMethod { + val, err := m.GetBackingStore().Get("httpMethod") + if err != nil { + panic(err) + } + if val != nil { + return val.(*RequestHttpMethod) + } + return nil +} + +// GetIsBlocked gets the isBlocked property value. The isBlocked property +// returns a *bool when successful +func (m *PoliciesEvaluationResult) GetIsBlocked() *bool { + val, err := m.GetBackingStore().Get("isBlocked") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PoliciesEvaluationResult) GetMessage() *string { + val, err := m.GetBackingStore().Get("message") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetNormalizedRequestInput gets the normalizedRequestInput property value. The normalizedRequestInput property +// returns a UntypedNodeable when successful +func (m *PoliciesEvaluationResult) GetNormalizedRequestInput() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("normalizedRequestInput") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *PoliciesEvaluationResult) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetResourceUri gets the resourceUri property value. The resourceUri property +// returns a *string when successful +func (m *PoliciesEvaluationResult) GetResourceUri() *string { + val, err := m.GetBackingStore().Get("resourceUri") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PoliciesEvaluationResult) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetAppliedPoliciesEffects() != nil { + cast := (*m.GetAppliedPoliciesEffects()).String() + err := writer.WriteStringValue("appliedPoliciesEffects", &cast) + if err != nil { + return err + } + } + if m.GetHttpMethod() != nil { + cast := (*m.GetHttpMethod()).String() + err := writer.WriteStringValue("httpMethod", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PoliciesEvaluationResult) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAppliedPoliciesEffects sets the appliedPoliciesEffects property value. The appliedPoliciesEffects property +func (m *PoliciesEvaluationResult) SetAppliedPoliciesEffects(value *PolicyEffects) { + err := m.GetBackingStore().Set("appliedPoliciesEffects", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *PoliciesEvaluationResult) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDetails sets the details property value. The details property +func (m *PoliciesEvaluationResult) SetDetails(value []PoliciesEvaluationDetailable) { + err := m.GetBackingStore().Set("details", value) + if err != nil { + panic(err) + } +} + +// SetHttpMethod sets the httpMethod property value. The httpMethod property +func (m *PoliciesEvaluationResult) SetHttpMethod(value *RequestHttpMethod) { + err := m.GetBackingStore().Set("httpMethod", value) + if err != nil { + panic(err) + } +} + +// SetIsBlocked sets the isBlocked property value. The isBlocked property +func (m *PoliciesEvaluationResult) SetIsBlocked(value *bool) { + err := m.GetBackingStore().Set("isBlocked", value) + if err != nil { + panic(err) + } +} + +// SetMessage sets the message property value. The message property +func (m *PoliciesEvaluationResult) SetMessage(value *string) { + err := m.GetBackingStore().Set("message", value) + if err != nil { + panic(err) + } +} + +// SetNormalizedRequestInput sets the normalizedRequestInput property value. The normalizedRequestInput property +func (m *PoliciesEvaluationResult) SetNormalizedRequestInput(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("normalizedRequestInput", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PoliciesEvaluationResult) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetResourceUri sets the resourceUri property value. The resourceUri property +func (m *PoliciesEvaluationResult) SetResourceUri(value *string) { + err := m.GetBackingStore().Set("resourceUri", value) + if err != nil { + panic(err) + } +} + +type PoliciesEvaluationResultable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppliedPoliciesEffects() *PolicyEffects + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDetails() []PoliciesEvaluationDetailable + GetHttpMethod() *RequestHttpMethod + GetIsBlocked() *bool + GetMessage() *string + GetNormalizedRequestInput() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetOdataType() *string + GetResourceUri() *string + SetAppliedPoliciesEffects(value *PolicyEffects) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDetails(value []PoliciesEvaluationDetailable) + SetHttpMethod(value *RequestHttpMethod) + SetIsBlocked(value *bool) + SetMessage(value *string) + SetNormalizedRequestInput(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetOdataType(value *string) + SetResourceUri(value *string) +} diff --git a/models/policy_applicable_operations.go b/models/policy_applicable_operations.go new file mode 100644 index 00000000000..d7826a9f18c --- /dev/null +++ b/models/policy_applicable_operations.go @@ -0,0 +1,65 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + "math" + "strings" +) + +type PolicyApplicableOperations int + +const ( + CREATE_POLICYAPPLICABLEOPERATIONS = 1 + UPDATEORUPSERT_POLICYAPPLICABLEOPERATIONS = 2 + DELETE_POLICYAPPLICABLEOPERATIONS = 4 + INVOKEACTION_POLICYAPPLICABLEOPERATIONS = 8 + UNKNOWNFUTUREVALUE_POLICYAPPLICABLEOPERATIONS = 16 +) + +func (i PolicyApplicableOperations) String() string { + var values []string + options := []string{"create", "updateOrUpsert", "delete", "invokeAction", "unknownFutureValue"} + for p := 0; p < 5; p++ { + mantis := PolicyApplicableOperations(int(math.Pow(2, float64(p)))) + if i&mantis == mantis { + values = append(values, options[p]) + } + } + return strings.Join(values, ",") +} + +func ParsePolicyApplicableOperations(v string) (any, error) { + var result PolicyApplicableOperations + values := strings.Split(v, ",") + for _, str := range values { + switch str { + case "create": + result |= CREATE_POLICYAPPLICABLEOPERATIONS + case "updateOrUpsert": + result |= UPDATEORUPSERT_POLICYAPPLICABLEOPERATIONS + case "delete": + result |= DELETE_POLICYAPPLICABLEOPERATIONS + case "invokeAction": + result |= INVOKEACTION_POLICYAPPLICABLEOPERATIONS + case "unknownFutureValue": + result |= UNKNOWNFUTUREVALUE_POLICYAPPLICABLEOPERATIONS + default: + return nil, nil + } + } + return &result, nil +} + +func SerializePolicyApplicableOperations(values []PolicyApplicableOperations) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i PolicyApplicableOperations) isMultiValue() bool { + return true +} diff --git a/models/policy_applies_to.go b/models/policy_applies_to.go new file mode 100644 index 00000000000..037c6216bd3 --- /dev/null +++ b/models/policy_applies_to.go @@ -0,0 +1,244 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type PolicyAppliesTo struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewPolicyAppliesTo instantiates a new PolicyAppliesTo and sets the default values. +func NewPolicyAppliesTo() *PolicyAppliesTo { + m := &PolicyAppliesTo{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreatePolicyAppliesToFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePolicyAppliesToFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPolicyAppliesTo(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PolicyAppliesTo) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *PolicyAppliesTo) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PolicyAppliesTo) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["includeDerivedTypes"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncludeDerivedTypes(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["operations"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePolicyApplicableOperations) + if err != nil { + return err + } + if val != nil { + m.SetOperations(val.(*PolicyApplicableOperations)) + } + return nil + } + res["resourceName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResourceName(val) + } + return nil + } + return res +} + +// GetIncludeDerivedTypes gets the includeDerivedTypes property value. The includeDerivedTypes property +// returns a *bool when successful +func (m *PolicyAppliesTo) GetIncludeDerivedTypes() *bool { + val, err := m.GetBackingStore().Get("includeDerivedTypes") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *PolicyAppliesTo) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOperations gets the operations property value. The operations property +// returns a *PolicyApplicableOperations when successful +func (m *PolicyAppliesTo) GetOperations() *PolicyApplicableOperations { + val, err := m.GetBackingStore().Get("operations") + if err != nil { + panic(err) + } + if val != nil { + return val.(*PolicyApplicableOperations) + } + return nil +} + +// GetResourceName gets the resourceName property value. The resourceName property +// returns a *string when successful +func (m *PolicyAppliesTo) GetResourceName() *string { + val, err := m.GetBackingStore().Get("resourceName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PolicyAppliesTo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteBoolValue("includeDerivedTypes", m.GetIncludeDerivedTypes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetOperations() != nil { + cast := (*m.GetOperations()).String() + err := writer.WriteStringValue("operations", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resourceName", m.GetResourceName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PolicyAppliesTo) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *PolicyAppliesTo) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetIncludeDerivedTypes sets the includeDerivedTypes property value. The includeDerivedTypes property +func (m *PolicyAppliesTo) SetIncludeDerivedTypes(value *bool) { + err := m.GetBackingStore().Set("includeDerivedTypes", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PolicyAppliesTo) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetOperations sets the operations property value. The operations property +func (m *PolicyAppliesTo) SetOperations(value *PolicyApplicableOperations) { + err := m.GetBackingStore().Set("operations", value) + if err != nil { + panic(err) + } +} + +// SetResourceName sets the resourceName property value. The resourceName property +func (m *PolicyAppliesTo) SetResourceName(value *string) { + err := m.GetBackingStore().Set("resourceName", value) + if err != nil { + panic(err) + } +} + +type PolicyAppliesToable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetIncludeDerivedTypes() *bool + GetOdataType() *string + GetOperations() *PolicyApplicableOperations + GetResourceName() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetIncludeDerivedTypes(value *bool) + SetOdataType(value *string) + SetOperations(value *PolicyApplicableOperations) + SetResourceName(value *string) +} diff --git a/models/policy_category.go b/models/policy_category.go new file mode 100644 index 00000000000..fe3c1c8bce3 --- /dev/null +++ b/models/policy_category.go @@ -0,0 +1,58 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type PolicyCategory int + +const ( + NOTSPECIFIED_POLICYCATEGORY PolicyCategory = iota + WORKLOADIDENTITY_POLICYCATEGORY + IDENTITYANDTENANT_POLICYCATEGORY + PRIVILEGEDACCESS_POLICYCATEGORY + ZEROTRUST_POLICYCATEGORY + AGENTICIDENTITY_POLICYCATEGORY + NETWORKACCESS_POLICYCATEGORY + UNKNOWNFUTUREVALUE_POLICYCATEGORY +) + +func (i PolicyCategory) String() string { + return []string{"notSpecified", "workloadIdentity", "identityAndTenant", "privilegedAccess", "zeroTrust", "agenticIdentity", "networkAccess", "unknownFutureValue"}[i] +} + +func ParsePolicyCategory(v string) (any, error) { + result := NOTSPECIFIED_POLICYCATEGORY + switch v { + case "notSpecified": + result = NOTSPECIFIED_POLICYCATEGORY + case "workloadIdentity": + result = WORKLOADIDENTITY_POLICYCATEGORY + case "identityAndTenant": + result = IDENTITYANDTENANT_POLICYCATEGORY + case "privilegedAccess": + result = PRIVILEGEDACCESS_POLICYCATEGORY + case "zeroTrust": + result = ZEROTRUST_POLICYCATEGORY + case "agenticIdentity": + result = AGENTICIDENTITY_POLICYCATEGORY + case "networkAccess": + result = NETWORKACCESS_POLICYCATEGORY + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_POLICYCATEGORY + default: + return nil, nil + } + return &result, nil +} + +func SerializePolicyCategory(values []PolicyCategory) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i PolicyCategory) isMultiValue() bool { + return false +} diff --git a/models/policy_definition_reference.go b/models/policy_definition_reference.go new file mode 100644 index 00000000000..74029680c49 --- /dev/null +++ b/models/policy_definition_reference.go @@ -0,0 +1,166 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PolicyDefinitionReference struct { + AssignedPolicyReference +} + +// NewPolicyDefinitionReference instantiates a new PolicyDefinitionReference and sets the default values. +func NewPolicyDefinitionReference() *PolicyDefinitionReference { + m := &PolicyDefinitionReference{ + AssignedPolicyReference: *NewAssignedPolicyReference(), + } + odataTypeValue := "#microsoft.graph.policyDefinitionReference" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreatePolicyDefinitionReferenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePolicyDefinitionReferenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPolicyDefinitionReference(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PolicyDefinitionReference) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.AssignedPolicyReference.GetFieldDeserializers() + res["policyDefinition"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateResourcePolicyDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPolicyDefinition(val.(ResourcePolicyDefinitionable)) + } + return nil + } + res["policyUniqueName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicyUniqueName(val) + } + return nil + } + res["version"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} + +// GetPolicyDefinition gets the policyDefinition property value. The policyDefinition property +// returns a ResourcePolicyDefinitionable when successful +func (m *PolicyDefinitionReference) GetPolicyDefinition() ResourcePolicyDefinitionable { + val, err := m.GetBackingStore().Get("policyDefinition") + if err != nil { + panic(err) + } + if val != nil { + return val.(ResourcePolicyDefinitionable) + } + return nil +} + +// GetPolicyUniqueName gets the policyUniqueName property value. The policyUniqueName property +// returns a *string when successful +func (m *PolicyDefinitionReference) GetPolicyUniqueName() *string { + val, err := m.GetBackingStore().Get("policyUniqueName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *PolicyDefinitionReference) GetVersion() *string { + val, err := m.GetBackingStore().Get("version") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PolicyDefinitionReference) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.AssignedPolicyReference.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("policyDefinition", m.GetPolicyDefinition()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("policyUniqueName", m.GetPolicyUniqueName()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("version", m.GetVersion()) + if err != nil { + return err + } + } + return nil +} + +// SetPolicyDefinition sets the policyDefinition property value. The policyDefinition property +func (m *PolicyDefinitionReference) SetPolicyDefinition(value ResourcePolicyDefinitionable) { + err := m.GetBackingStore().Set("policyDefinition", value) + if err != nil { + panic(err) + } +} + +// SetPolicyUniqueName sets the policyUniqueName property value. The policyUniqueName property +func (m *PolicyDefinitionReference) SetPolicyUniqueName(value *string) { + err := m.GetBackingStore().Set("policyUniqueName", value) + if err != nil { + panic(err) + } +} + +// SetVersion sets the version property value. The version property +func (m *PolicyDefinitionReference) SetVersion(value *string) { + err := m.GetBackingStore().Set("version", value) + if err != nil { + panic(err) + } +} + +type PolicyDefinitionReferenceable interface { + AssignedPolicyReferenceable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPolicyDefinition() ResourcePolicyDefinitionable + GetPolicyUniqueName() *string + GetVersion() *string + SetPolicyDefinition(value ResourcePolicyDefinitionable) + SetPolicyUniqueName(value *string) + SetVersion(value *string) +} diff --git a/models/policy_effect.go b/models/policy_effect.go new file mode 100644 index 00000000000..97947fb636a --- /dev/null +++ b/models/policy_effect.go @@ -0,0 +1,43 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type PolicyEffect int + +const ( + COMPLIANT_POLICYEFFECT PolicyEffect = iota + DENY_POLICYEFFECT + UNKNOWNFUTUREVALUE_POLICYEFFECT +) + +func (i PolicyEffect) String() string { + return []string{"compliant", "deny", "unknownFutureValue"}[i] +} + +func ParsePolicyEffect(v string) (any, error) { + result := COMPLIANT_POLICYEFFECT + switch v { + case "compliant": + result = COMPLIANT_POLICYEFFECT + case "deny": + result = DENY_POLICYEFFECT + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_POLICYEFFECT + default: + return nil, nil + } + return &result, nil +} + +func SerializePolicyEffect(values []PolicyEffect) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i PolicyEffect) isMultiValue() bool { + return false +} diff --git a/models/policy_effects.go b/models/policy_effects.go new file mode 100644 index 00000000000..5f50d6e3bfa --- /dev/null +++ b/models/policy_effects.go @@ -0,0 +1,59 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + "math" + "strings" +) + +type PolicyEffects int + +const ( + COMPLIANT_POLICYEFFECTS = 1 + DENY_POLICYEFFECTS = 2 + UNKNOWNFUTUREVALUE_POLICYEFFECTS = 4 +) + +func (i PolicyEffects) String() string { + var values []string + options := []string{"compliant", "deny", "unknownFutureValue"} + for p := 0; p < 3; p++ { + mantis := PolicyEffects(int(math.Pow(2, float64(p)))) + if i&mantis == mantis { + values = append(values, options[p]) + } + } + return strings.Join(values, ",") +} + +func ParsePolicyEffects(v string) (any, error) { + var result PolicyEffects + values := strings.Split(v, ",") + for _, str := range values { + switch str { + case "compliant": + result |= COMPLIANT_POLICYEFFECTS + case "deny": + result |= DENY_POLICYEFFECTS + case "unknownFutureValue": + result |= UNKNOWNFUTUREVALUE_POLICYEFFECTS + default: + return nil, nil + } + } + return &result, nil +} + +func SerializePolicyEffects(values []PolicyEffects) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i PolicyEffects) isMultiValue() bool { + return true +} diff --git a/models/policy_evaluation_detail.go b/models/policy_evaluation_detail.go new file mode 100644 index 00000000000..330d85078ee --- /dev/null +++ b/models/policy_evaluation_detail.go @@ -0,0 +1,607 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type PolicyEvaluationDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewPolicyEvaluationDetail instantiates a new PolicyEvaluationDetail and sets the default values. +func NewPolicyEvaluationDetail() *PolicyEvaluationDetail { + m := &PolicyEvaluationDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreatePolicyEvaluationDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePolicyEvaluationDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPolicyEvaluationDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PolicyEvaluationDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetApplicabilityEvaluationError gets the applicabilityEvaluationError property value. The applicabilityEvaluationError property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetApplicabilityEvaluationError() *string { + val, err := m.GetBackingStore().Get("applicabilityEvaluationError") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetAppliedPolicyEffects gets the appliedPolicyEffects property value. The appliedPolicyEffects property +// returns a *PolicyEffect when successful +func (m *PolicyEvaluationDetail) GetAppliedPolicyEffects() *PolicyEffect { + val, err := m.GetBackingStore().Get("appliedPolicyEffects") + if err != nil { + panic(err) + } + if val != nil { + return val.(*PolicyEffect) + } + return nil +} + +// GetAssignedPolicyDisplayName gets the assignedPolicyDisplayName property value. The assignedPolicyDisplayName property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetAssignedPolicyDisplayName() *string { + val, err := m.GetBackingStore().Get("assignedPolicyDisplayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetAssignmentUniqueName gets the assignmentUniqueName property value. The assignmentUniqueName property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetAssignmentUniqueName() *string { + val, err := m.GetBackingStore().Get("assignmentUniqueName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *PolicyEvaluationDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetEvaluationError gets the evaluationError property value. The evaluationError property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetEvaluationError() *string { + val, err := m.GetBackingStore().Get("evaluationError") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFetchDetails gets the fetchDetails property value. The fetchDetails property +// returns a []FetchDetailable when successful +func (m *PolicyEvaluationDetail) GetFetchDetails() []FetchDetailable { + val, err := m.GetBackingStore().Get("fetchDetails") + if err != nil { + panic(err) + } + if val != nil { + return val.([]FetchDetailable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PolicyEvaluationDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["applicabilityEvaluationError"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetApplicabilityEvaluationError(val) + } + return nil + } + res["appliedPolicyEffects"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePolicyEffect) + if err != nil { + return err + } + if val != nil { + m.SetAppliedPolicyEffects(val.(*PolicyEffect)) + } + return nil + } + res["assignedPolicyDisplayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignedPolicyDisplayName(val) + } + return nil + } + res["assignmentUniqueName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignmentUniqueName(val) + } + return nil + } + res["evaluationError"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvaluationError(val) + } + return nil + } + res["fetchDetails"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateFetchDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]FetchDetailable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(FetchDetailable) + } + } + m.SetFetchDetails(res) + } + return nil + } + res["isApplicable"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsApplicable(val) + } + return nil + } + res["isCompliant"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsCompliant(val) + } + return nil + } + res["isEnforced"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsEnforced(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["policyLoadingError"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicyLoadingError(val) + } + return nil + } + res["policyMessage"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicyMessage(val) + } + return nil + } + res["policyVersion"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicyVersion(val) + } + return nil + } + return res +} + +// GetIsApplicable gets the isApplicable property value. The isApplicable property +// returns a *bool when successful +func (m *PolicyEvaluationDetail) GetIsApplicable() *bool { + val, err := m.GetBackingStore().Get("isApplicable") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetIsCompliant gets the isCompliant property value. The isCompliant property +// returns a *bool when successful +func (m *PolicyEvaluationDetail) GetIsCompliant() *bool { + val, err := m.GetBackingStore().Get("isCompliant") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetIsEnforced gets the isEnforced property value. The isEnforced property +// returns a *bool when successful +func (m *PolicyEvaluationDetail) GetIsEnforced() *bool { + val, err := m.GetBackingStore().Get("isEnforced") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPolicyLoadingError gets the policyLoadingError property value. The policyLoadingError property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetPolicyLoadingError() *string { + val, err := m.GetBackingStore().Get("policyLoadingError") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPolicyMessage gets the policyMessage property value. The policyMessage property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetPolicyMessage() *string { + val, err := m.GetBackingStore().Get("policyMessage") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPolicyVersion gets the policyVersion property value. The policyVersion property +// returns a *string when successful +func (m *PolicyEvaluationDetail) GetPolicyVersion() *string { + val, err := m.GetBackingStore().Get("policyVersion") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PolicyEvaluationDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("applicabilityEvaluationError", m.GetApplicabilityEvaluationError()) + if err != nil { + return err + } + } + if m.GetAppliedPolicyEffects() != nil { + cast := (*m.GetAppliedPolicyEffects()).String() + err := writer.WriteStringValue("appliedPolicyEffects", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignedPolicyDisplayName", m.GetAssignedPolicyDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignmentUniqueName", m.GetAssignmentUniqueName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("evaluationError", m.GetEvaluationError()) + if err != nil { + return err + } + } + if m.GetFetchDetails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFetchDetails())) + for i, v := range m.GetFetchDetails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("fetchDetails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isApplicable", m.GetIsApplicable()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isCompliant", m.GetIsCompliant()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isEnforced", m.GetIsEnforced()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("policyLoadingError", m.GetPolicyLoadingError()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("policyMessage", m.GetPolicyMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("policyVersion", m.GetPolicyVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PolicyEvaluationDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetApplicabilityEvaluationError sets the applicabilityEvaluationError property value. The applicabilityEvaluationError property +func (m *PolicyEvaluationDetail) SetApplicabilityEvaluationError(value *string) { + err := m.GetBackingStore().Set("applicabilityEvaluationError", value) + if err != nil { + panic(err) + } +} + +// SetAppliedPolicyEffects sets the appliedPolicyEffects property value. The appliedPolicyEffects property +func (m *PolicyEvaluationDetail) SetAppliedPolicyEffects(value *PolicyEffect) { + err := m.GetBackingStore().Set("appliedPolicyEffects", value) + if err != nil { + panic(err) + } +} + +// SetAssignedPolicyDisplayName sets the assignedPolicyDisplayName property value. The assignedPolicyDisplayName property +func (m *PolicyEvaluationDetail) SetAssignedPolicyDisplayName(value *string) { + err := m.GetBackingStore().Set("assignedPolicyDisplayName", value) + if err != nil { + panic(err) + } +} + +// SetAssignmentUniqueName sets the assignmentUniqueName property value. The assignmentUniqueName property +func (m *PolicyEvaluationDetail) SetAssignmentUniqueName(value *string) { + err := m.GetBackingStore().Set("assignmentUniqueName", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *PolicyEvaluationDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetEvaluationError sets the evaluationError property value. The evaluationError property +func (m *PolicyEvaluationDetail) SetEvaluationError(value *string) { + err := m.GetBackingStore().Set("evaluationError", value) + if err != nil { + panic(err) + } +} + +// SetFetchDetails sets the fetchDetails property value. The fetchDetails property +func (m *PolicyEvaluationDetail) SetFetchDetails(value []FetchDetailable) { + err := m.GetBackingStore().Set("fetchDetails", value) + if err != nil { + panic(err) + } +} + +// SetIsApplicable sets the isApplicable property value. The isApplicable property +func (m *PolicyEvaluationDetail) SetIsApplicable(value *bool) { + err := m.GetBackingStore().Set("isApplicable", value) + if err != nil { + panic(err) + } +} + +// SetIsCompliant sets the isCompliant property value. The isCompliant property +func (m *PolicyEvaluationDetail) SetIsCompliant(value *bool) { + err := m.GetBackingStore().Set("isCompliant", value) + if err != nil { + panic(err) + } +} + +// SetIsEnforced sets the isEnforced property value. The isEnforced property +func (m *PolicyEvaluationDetail) SetIsEnforced(value *bool) { + err := m.GetBackingStore().Set("isEnforced", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PolicyEvaluationDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetPolicyLoadingError sets the policyLoadingError property value. The policyLoadingError property +func (m *PolicyEvaluationDetail) SetPolicyLoadingError(value *string) { + err := m.GetBackingStore().Set("policyLoadingError", value) + if err != nil { + panic(err) + } +} + +// SetPolicyMessage sets the policyMessage property value. The policyMessage property +func (m *PolicyEvaluationDetail) SetPolicyMessage(value *string) { + err := m.GetBackingStore().Set("policyMessage", value) + if err != nil { + panic(err) + } +} + +// SetPolicyVersion sets the policyVersion property value. The policyVersion property +func (m *PolicyEvaluationDetail) SetPolicyVersion(value *string) { + err := m.GetBackingStore().Set("policyVersion", value) + if err != nil { + panic(err) + } +} + +type PolicyEvaluationDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApplicabilityEvaluationError() *string + GetAppliedPolicyEffects() *PolicyEffect + GetAssignedPolicyDisplayName() *string + GetAssignmentUniqueName() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetEvaluationError() *string + GetFetchDetails() []FetchDetailable + GetIsApplicable() *bool + GetIsCompliant() *bool + GetIsEnforced() *bool + GetOdataType() *string + GetPolicyLoadingError() *string + GetPolicyMessage() *string + GetPolicyVersion() *string + SetApplicabilityEvaluationError(value *string) + SetAppliedPolicyEffects(value *PolicyEffect) + SetAssignedPolicyDisplayName(value *string) + SetAssignmentUniqueName(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetEvaluationError(value *string) + SetFetchDetails(value []FetchDetailable) + SetIsApplicable(value *bool) + SetIsCompliant(value *bool) + SetIsEnforced(value *bool) + SetOdataType(value *string) + SetPolicyLoadingError(value *string) + SetPolicyMessage(value *string) + SetPolicyVersion(value *string) +} diff --git a/models/policy_evaluation_error_detail.go b/models/policy_evaluation_error_detail.go new file mode 100644 index 00000000000..c53de4e2437 --- /dev/null +++ b/models/policy_evaluation_error_detail.go @@ -0,0 +1,243 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type PolicyEvaluationErrorDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewPolicyEvaluationErrorDetail instantiates a new PolicyEvaluationErrorDetail and sets the default values. +func NewPolicyEvaluationErrorDetail() *PolicyEvaluationErrorDetail { + m := &PolicyEvaluationErrorDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreatePolicyEvaluationErrorDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePolicyEvaluationErrorDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPolicyEvaluationErrorDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PolicyEvaluationErrorDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetApplicabilityEvaluationError gets the applicabilityEvaluationError property value. The applicabilityEvaluationError property +// returns a *string when successful +func (m *PolicyEvaluationErrorDetail) GetApplicabilityEvaluationError() *string { + val, err := m.GetBackingStore().Get("applicabilityEvaluationError") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *PolicyEvaluationErrorDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetEffectEvaluationError gets the effectEvaluationError property value. The effectEvaluationError property +// returns a *string when successful +func (m *PolicyEvaluationErrorDetail) GetEffectEvaluationError() *string { + val, err := m.GetBackingStore().Get("effectEvaluationError") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PolicyEvaluationErrorDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["applicabilityEvaluationError"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetApplicabilityEvaluationError(val) + } + return nil + } + res["effectEvaluationError"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEffectEvaluationError(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["policyLoadingError"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicyLoadingError(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *PolicyEvaluationErrorDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPolicyLoadingError gets the policyLoadingError property value. The policyLoadingError property +// returns a *string when successful +func (m *PolicyEvaluationErrorDetail) GetPolicyLoadingError() *string { + val, err := m.GetBackingStore().Get("policyLoadingError") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PolicyEvaluationErrorDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("applicabilityEvaluationError", m.GetApplicabilityEvaluationError()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("effectEvaluationError", m.GetEffectEvaluationError()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("policyLoadingError", m.GetPolicyLoadingError()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PolicyEvaluationErrorDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetApplicabilityEvaluationError sets the applicabilityEvaluationError property value. The applicabilityEvaluationError property +func (m *PolicyEvaluationErrorDetail) SetApplicabilityEvaluationError(value *string) { + err := m.GetBackingStore().Set("applicabilityEvaluationError", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *PolicyEvaluationErrorDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetEffectEvaluationError sets the effectEvaluationError property value. The effectEvaluationError property +func (m *PolicyEvaluationErrorDetail) SetEffectEvaluationError(value *string) { + err := m.GetBackingStore().Set("effectEvaluationError", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PolicyEvaluationErrorDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetPolicyLoadingError sets the policyLoadingError property value. The policyLoadingError property +func (m *PolicyEvaluationErrorDetail) SetPolicyLoadingError(value *string) { + err := m.GetBackingStore().Set("policyLoadingError", value) + if err != nil { + panic(err) + } +} + +type PolicyEvaluationErrorDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApplicabilityEvaluationError() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetEffectEvaluationError() *string + GetOdataType() *string + GetPolicyLoadingError() *string + SetApplicabilityEvaluationError(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetEffectEvaluationError(value *string) + SetOdataType(value *string) + SetPolicyLoadingError(value *string) +} diff --git a/models/privileged_read_setting.go b/models/privileged_read_setting.go new file mode 100644 index 00000000000..385004bf8fb --- /dev/null +++ b/models/privileged_read_setting.go @@ -0,0 +1,165 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type PrivilegedReadSetting struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewPrivilegedReadSetting instantiates a new PrivilegedReadSetting and sets the default values. +func NewPrivilegedReadSetting() *PrivilegedReadSetting { + m := &PrivilegedReadSetting{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreatePrivilegedReadSettingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivilegedReadSettingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivilegedReadSetting(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *PrivilegedReadSetting) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAppId gets the appId property value. The appId property +// returns a *string when successful +func (m *PrivilegedReadSetting) GetAppId() *string { + val, err := m.GetBackingStore().Get("appId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *PrivilegedReadSetting) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *PrivilegedReadSetting) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["appId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *PrivilegedReadSetting) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *PrivilegedReadSetting) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("appId", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *PrivilegedReadSetting) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAppId sets the appId property value. The appId property +func (m *PrivilegedReadSetting) SetAppId(value *string) { + err := m.GetBackingStore().Set("appId", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *PrivilegedReadSetting) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *PrivilegedReadSetting) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type PrivilegedReadSettingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetAppId(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/provenance_actor_type.go b/models/provenance_actor_type.go new file mode 100644 index 00000000000..e51e230f42c --- /dev/null +++ b/models/provenance_actor_type.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ProvenanceActorType int + +const ( + SYSTEM_PROVENANCEACTORTYPE ProvenanceActorType = iota + USER_PROVENANCEACTORTYPE + APPLICATION_PROVENANCEACTORTYPE + UNKNOWNFUTUREVALUE_PROVENANCEACTORTYPE +) + +func (i ProvenanceActorType) String() string { + return []string{"system", "user", "application", "unknownFutureValue"}[i] +} + +func ParseProvenanceActorType(v string) (any, error) { + result := SYSTEM_PROVENANCEACTORTYPE + switch v { + case "system": + result = SYSTEM_PROVENANCEACTORTYPE + case "user": + result = USER_PROVENANCEACTORTYPE + case "application": + result = APPLICATION_PROVENANCEACTORTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_PROVENANCEACTORTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeProvenanceActorType(values []ProvenanceActorType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ProvenanceActorType) isMultiValue() bool { + return false +} diff --git a/models/provenance_asserted_by.go b/models/provenance_asserted_by.go new file mode 100644 index 00000000000..0501539bd11 --- /dev/null +++ b/models/provenance_asserted_by.go @@ -0,0 +1,205 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ProvenanceAssertedBy struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewProvenanceAssertedBy instantiates a new ProvenanceAssertedBy and sets the default values. +func NewProvenanceAssertedBy() *ProvenanceAssertedBy { + m := &ProvenanceAssertedBy{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateProvenanceAssertedByFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProvenanceAssertedByFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProvenanceAssertedBy(), nil +} + +// GetActorId gets the actorId property value. The identifier of the actor that established the provenance. +// returns a *string when successful +func (m *ProvenanceAssertedBy) GetActorId() *string { + val, err := m.GetBackingStore().Get("actorId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetActorType gets the actorType property value. The actorType property +// returns a *ProvenanceActorType when successful +func (m *ProvenanceAssertedBy) GetActorType() *ProvenanceActorType { + val, err := m.GetBackingStore().Get("actorType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ProvenanceActorType) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ProvenanceAssertedBy) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ProvenanceAssertedBy) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ProvenanceAssertedBy) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["actorId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actorType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseProvenanceActorType) + if err != nil { + return err + } + if val != nil { + m.SetActorType(val.(*ProvenanceActorType)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ProvenanceAssertedBy) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ProvenanceAssertedBy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("actorId", m.GetActorId()) + if err != nil { + return err + } + } + if m.GetActorType() != nil { + cast := (*m.GetActorType()).String() + err := writer.WriteStringValue("actorType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetActorId sets the actorId property value. The identifier of the actor that established the provenance. +func (m *ProvenanceAssertedBy) SetActorId(value *string) { + err := m.GetBackingStore().Set("actorId", value) + if err != nil { + panic(err) + } +} + +// SetActorType sets the actorType property value. The actorType property +func (m *ProvenanceAssertedBy) SetActorType(value *ProvenanceActorType) { + err := m.GetBackingStore().Set("actorType", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ProvenanceAssertedBy) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ProvenanceAssertedBy) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ProvenanceAssertedBy) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type ProvenanceAssertedByable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId() *string + GetActorType() *ProvenanceActorType + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetActorId(value *string) + SetActorType(value *ProvenanceActorType) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/provenance_assertion.go b/models/provenance_assertion.go new file mode 100644 index 00000000000..8c5f4542d8c --- /dev/null +++ b/models/provenance_assertion.go @@ -0,0 +1,362 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ProvenanceAssertion struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewProvenanceAssertion instantiates a new ProvenanceAssertion and sets the default values. +func NewProvenanceAssertion() *ProvenanceAssertion { + m := &ProvenanceAssertion{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateProvenanceAssertionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProvenanceAssertionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProvenanceAssertion(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ProvenanceAssertion) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAttestationReason gets the attestationReason property value. The reason supplied for a manual attestation. +// returns a *string when successful +func (m *ProvenanceAssertion) GetAttestationReason() *string { + val, err := m.GetBackingStore().Get("attestationReason") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ProvenanceAssertion) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetEventDateTime gets the eventDateTime property value. The date and time of the provenance event represented by this assertion. +// returns a *Time when successful +func (m *ProvenanceAssertion) GetEventDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("eventDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ProvenanceAssertion) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["attestationReason"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAttestationReason(val) + } + return nil + } + res["eventDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetEventDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["provenanceType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseProvenanceAssertionType) + if err != nil { + return err + } + if val != nil { + m.SetProvenanceType(val.(*ProvenanceAssertionType)) + } + return nil + } + res["sourceCredentialId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceCredentialId(val) + } + return nil + } + res["sourceCredentialType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceCredentialType(val) + } + return nil + } + res["verificationEventId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVerificationEventId(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ProvenanceAssertion) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetProvenanceType gets the provenanceType property value. The provenanceType property +// returns a *ProvenanceAssertionType when successful +func (m *ProvenanceAssertion) GetProvenanceType() *ProvenanceAssertionType { + val, err := m.GetBackingStore().Get("provenanceType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ProvenanceAssertionType) + } + return nil +} + +// GetSourceCredentialId gets the sourceCredentialId property value. The identifier of the credential from which this credential was derived. +// returns a *string when successful +func (m *ProvenanceAssertion) GetSourceCredentialId() *string { + val, err := m.GetBackingStore().Get("sourceCredentialId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSourceCredentialType gets the sourceCredentialType property value. The type of credential from which this credential was derived. +// returns a *string when successful +func (m *ProvenanceAssertion) GetSourceCredentialType() *string { + val, err := m.GetBackingStore().Get("sourceCredentialType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetVerificationEventId gets the verificationEventId property value. The identifier of the identityVerificationEvent that supports this assertion. +// returns a *string when successful +func (m *ProvenanceAssertion) GetVerificationEventId() *string { + val, err := m.GetBackingStore().Get("verificationEventId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ProvenanceAssertion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("attestationReason", m.GetAttestationReason()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("eventDateTime", m.GetEventDateTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetProvenanceType() != nil { + cast := (*m.GetProvenanceType()).String() + err := writer.WriteStringValue("provenanceType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sourceCredentialId", m.GetSourceCredentialId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sourceCredentialType", m.GetSourceCredentialType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("verificationEventId", m.GetVerificationEventId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ProvenanceAssertion) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAttestationReason sets the attestationReason property value. The reason supplied for a manual attestation. +func (m *ProvenanceAssertion) SetAttestationReason(value *string) { + err := m.GetBackingStore().Set("attestationReason", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ProvenanceAssertion) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetEventDateTime sets the eventDateTime property value. The date and time of the provenance event represented by this assertion. +func (m *ProvenanceAssertion) SetEventDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("eventDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ProvenanceAssertion) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetProvenanceType sets the provenanceType property value. The provenanceType property +func (m *ProvenanceAssertion) SetProvenanceType(value *ProvenanceAssertionType) { + err := m.GetBackingStore().Set("provenanceType", value) + if err != nil { + panic(err) + } +} + +// SetSourceCredentialId sets the sourceCredentialId property value. The identifier of the credential from which this credential was derived. +func (m *ProvenanceAssertion) SetSourceCredentialId(value *string) { + err := m.GetBackingStore().Set("sourceCredentialId", value) + if err != nil { + panic(err) + } +} + +// SetSourceCredentialType sets the sourceCredentialType property value. The type of credential from which this credential was derived. +func (m *ProvenanceAssertion) SetSourceCredentialType(value *string) { + err := m.GetBackingStore().Set("sourceCredentialType", value) + if err != nil { + panic(err) + } +} + +// SetVerificationEventId sets the verificationEventId property value. The identifier of the identityVerificationEvent that supports this assertion. +func (m *ProvenanceAssertion) SetVerificationEventId(value *string) { + err := m.GetBackingStore().Set("verificationEventId", value) + if err != nil { + panic(err) + } +} + +type ProvenanceAssertionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAttestationReason() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetEventDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetProvenanceType() *ProvenanceAssertionType + GetSourceCredentialId() *string + GetSourceCredentialType() *string + GetVerificationEventId() *string + SetAttestationReason(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetEventDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetProvenanceType(value *ProvenanceAssertionType) + SetSourceCredentialId(value *string) + SetSourceCredentialType(value *string) + SetVerificationEventId(value *string) +} diff --git a/models/provenance_assertion_type.go b/models/provenance_assertion_type.go new file mode 100644 index 00000000000..d40d75bf86b --- /dev/null +++ b/models/provenance_assertion_type.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ProvenanceAssertionType int + +const ( + IDENTITYVERIFICATION_PROVENANCEASSERTIONTYPE ProvenanceAssertionType = iota + DERIVEDFROMCREDENTIAL_PROVENANCEASSERTIONTYPE + MANUALATTESTATION_PROVENANCEASSERTIONTYPE + UNKNOWNFUTUREVALUE_PROVENANCEASSERTIONTYPE +) + +func (i ProvenanceAssertionType) String() string { + return []string{"identityVerification", "derivedFromCredential", "manualAttestation", "unknownFutureValue"}[i] +} + +func ParseProvenanceAssertionType(v string) (any, error) { + result := IDENTITYVERIFICATION_PROVENANCEASSERTIONTYPE + switch v { + case "identityVerification": + result = IDENTITYVERIFICATION_PROVENANCEASSERTIONTYPE + case "derivedFromCredential": + result = DERIVEDFROMCREDENTIAL_PROVENANCEASSERTIONTYPE + case "manualAttestation": + result = MANUALATTESTATION_PROVENANCEASSERTIONTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_PROVENANCEASSERTIONTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeProvenanceAssertionType(values []ProvenanceAssertionType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ProvenanceAssertionType) isMultiValue() bool { + return false +} diff --git a/models/provenance_chain_status.go b/models/provenance_chain_status.go new file mode 100644 index 00000000000..2b908154020 --- /dev/null +++ b/models/provenance_chain_status.go @@ -0,0 +1,286 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ProvenanceChainStatus struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewProvenanceChainStatus instantiates a new ProvenanceChainStatus and sets the default values. +func NewProvenanceChainStatus() *ProvenanceChainStatus { + m := &ProvenanceChainStatus{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateProvenanceChainStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProvenanceChainStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProvenanceChainStatus(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ProvenanceChainStatus) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ProvenanceChainStatus) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetBreakDetectedAtDateTime gets the breakDetectedAtDateTime property value. The date and time when the service detected that the chain of trust was broken. +// returns a *Time when successful +func (m *ProvenanceChainStatus) GetBreakDetectedAtDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("breakDetectedAtDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetBreakReason gets the breakReason property value. The breakReason property +// returns a *ChainBreakReason when successful +func (m *ProvenanceChainStatus) GetBreakReason() *ChainBreakReason { + val, err := m.GetBackingStore().Get("breakReason") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ChainBreakReason) + } + return nil +} + +// GetBreakSource gets the breakSource property value. The breakSource property +// returns a *ChainBreakSource when successful +func (m *ProvenanceChainStatus) GetBreakSource() *ChainBreakSource { + val, err := m.GetBackingStore().Get("breakSource") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ChainBreakSource) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ProvenanceChainStatus) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["breakDetectedAtDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetBreakDetectedAtDateTime(val) + } + return nil + } + res["breakReason"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseChainBreakReason) + if err != nil { + return err + } + if val != nil { + m.SetBreakReason(val.(*ChainBreakReason)) + } + return nil + } + res["breakSource"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseChainBreakSource) + if err != nil { + return err + } + if val != nil { + m.SetBreakSource(val.(*ChainBreakSource)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseChainState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ChainState)) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ProvenanceChainStatus) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetState gets the state property value. The state property +// returns a *ChainState when successful +func (m *ProvenanceChainStatus) GetState() *ChainState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ChainState) + } + return nil +} + +// Serialize serializes information the current object +func (m *ProvenanceChainStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteTimeValue("breakDetectedAtDateTime", m.GetBreakDetectedAtDateTime()) + if err != nil { + return err + } + } + if m.GetBreakReason() != nil { + cast := (*m.GetBreakReason()).String() + err := writer.WriteStringValue("breakReason", &cast) + if err != nil { + return err + } + } + if m.GetBreakSource() != nil { + cast := (*m.GetBreakSource()).String() + err := writer.WriteStringValue("breakSource", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ProvenanceChainStatus) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ProvenanceChainStatus) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetBreakDetectedAtDateTime sets the breakDetectedAtDateTime property value. The date and time when the service detected that the chain of trust was broken. +func (m *ProvenanceChainStatus) SetBreakDetectedAtDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("breakDetectedAtDateTime", value) + if err != nil { + panic(err) + } +} + +// SetBreakReason sets the breakReason property value. The breakReason property +func (m *ProvenanceChainStatus) SetBreakReason(value *ChainBreakReason) { + err := m.GetBackingStore().Set("breakReason", value) + if err != nil { + panic(err) + } +} + +// SetBreakSource sets the breakSource property value. The breakSource property +func (m *ProvenanceChainStatus) SetBreakSource(value *ChainBreakSource) { + err := m.GetBackingStore().Set("breakSource", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ProvenanceChainStatus) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. The state property +func (m *ProvenanceChainStatus) SetState(value *ChainState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +type ProvenanceChainStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetBreakDetectedAtDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetBreakReason() *ChainBreakReason + GetBreakSource() *ChainBreakSource + GetOdataType() *string + GetState() *ChainState + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetBreakDetectedAtDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetBreakReason(value *ChainBreakReason) + SetBreakSource(value *ChainBreakSource) + SetOdataType(value *string) + SetState(value *ChainState) +} diff --git a/models/provenance_classification.go b/models/provenance_classification.go new file mode 100644 index 00000000000..8428a2cf67e --- /dev/null +++ b/models/provenance_classification.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ProvenanceClassification int + +const ( + HIGHASSURANCE_PROVENANCECLASSIFICATION ProvenanceClassification = iota + MEDIUMASSURANCE_PROVENANCECLASSIFICATION + LOWASSURANCE_PROVENANCECLASSIFICATION + UNKNOWNFUTUREVALUE_PROVENANCECLASSIFICATION +) + +func (i ProvenanceClassification) String() string { + return []string{"highAssurance", "mediumAssurance", "lowAssurance", "unknownFutureValue"}[i] +} + +func ParseProvenanceClassification(v string) (any, error) { + result := HIGHASSURANCE_PROVENANCECLASSIFICATION + switch v { + case "highAssurance": + result = HIGHASSURANCE_PROVENANCECLASSIFICATION + case "mediumAssurance": + result = MEDIUMASSURANCE_PROVENANCECLASSIFICATION + case "lowAssurance": + result = LOWASSURANCE_PROVENANCECLASSIFICATION + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_PROVENANCECLASSIFICATION + default: + return nil, nil + } + return &result, nil +} + +func SerializeProvenanceClassification(values []ProvenanceClassification) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ProvenanceClassification) isMultiValue() bool { + return false +} diff --git a/models/request_http_method.go b/models/request_http_method.go new file mode 100644 index 00000000000..1039787f568 --- /dev/null +++ b/models/request_http_method.go @@ -0,0 +1,52 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type RequestHttpMethod int + +const ( + POST_REQUESTHTTPMETHOD RequestHttpMethod = iota + PATCH_REQUESTHTTPMETHOD + PUT_REQUESTHTTPMETHOD + GET_REQUESTHTTPMETHOD + DELETE_REQUESTHTTPMETHOD + UNKNOWNFUTUREVALUE_REQUESTHTTPMETHOD +) + +func (i RequestHttpMethod) String() string { + return []string{"post", "patch", "put", "get", "delete", "unknownFutureValue"}[i] +} + +func ParseRequestHttpMethod(v string) (any, error) { + result := POST_REQUESTHTTPMETHOD + switch v { + case "post": + result = POST_REQUESTHTTPMETHOD + case "patch": + result = PATCH_REQUESTHTTPMETHOD + case "put": + result = PUT_REQUESTHTTPMETHOD + case "get": + result = GET_REQUESTHTTPMETHOD + case "delete": + result = DELETE_REQUESTHTTPMETHOD + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REQUESTHTTPMETHOD + default: + return nil, nil + } + return &result, nil +} + +func SerializeRequestHttpMethod(values []RequestHttpMethod) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RequestHttpMethod) isMultiValue() bool { + return false +} diff --git a/models/resource_policy_assignment.go b/models/resource_policy_assignment.go new file mode 100644 index 00000000000..810e99ff92f --- /dev/null +++ b/models/resource_policy_assignment.go @@ -0,0 +1,461 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ResourcePolicyAssignment struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyAssignment instantiates a new ResourcePolicyAssignment and sets the default values. +func NewResourcePolicyAssignment() *ResourcePolicyAssignment { + m := &ResourcePolicyAssignment{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateResourcePolicyAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyAssignment(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyAssignment) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAssignedPolicy gets the assignedPolicy property value. The assignedPolicy property +// returns a AssignedPolicyReferenceable when successful +func (m *ResourcePolicyAssignment) GetAssignedPolicy() AssignedPolicyReferenceable { + val, err := m.GetBackingStore().Get("assignedPolicy") + if err != nil { + panic(err) + } + if val != nil { + return val.(AssignedPolicyReferenceable) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyAssignment) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetCreatedDateTime gets the createdDateTime property value. The createdDateTime property +// returns a *Time when successful +func (m *ResourcePolicyAssignment) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDeletedDateTime gets the deletedDateTime property value. The deletedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyAssignment) GetDeletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("deletedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetEnforcementMode gets the enforcementMode property value. The enforcementMode property +// returns a *EnforcementMode when successful +func (m *ResourcePolicyAssignment) GetEnforcementMode() *EnforcementMode { + val, err := m.GetBackingStore().Get("enforcementMode") + if err != nil { + panic(err) + } + if val != nil { + return val.(*EnforcementMode) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyAssignment) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["assignedPolicy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAssignedPolicyReferenceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignedPolicy(val.(AssignedPolicyReferenceable)) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["deletedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletedDateTime(val) + } + return nil + } + res["enforcementMode"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnforcementMode) + if err != nil { + return err + } + if val != nil { + m.SetEnforcementMode(val.(*EnforcementMode)) + } + return nil + } + res["isEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsEnabled(val) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["params"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParams(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["scope"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScope(val) + } + return nil + } + res["uniqueName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUniqueName(val) + } + return nil + } + return res +} + +// GetIsEnabled gets the isEnabled property value. The isEnabled property +// returns a *bool when successful +func (m *ResourcePolicyAssignment) GetIsEnabled() *bool { + val, err := m.GetBackingStore().Get("isEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The lastModifiedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyAssignment) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ResourcePolicyAssignment) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetParams gets the params property value. The params property +// returns a UntypedNodeable when successful +func (m *ResourcePolicyAssignment) GetParams() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("params") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetScope gets the scope property value. The scope property +// returns a *string when successful +func (m *ResourcePolicyAssignment) GetScope() *string { + val, err := m.GetBackingStore().Get("scope") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUniqueName gets the uniqueName property value. The uniqueName property +// returns a *string when successful +func (m *ResourcePolicyAssignment) GetUniqueName() *string { + val, err := m.GetBackingStore().Get("uniqueName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("assignedPolicy", m.GetAssignedPolicy()) + if err != nil { + return err + } + } + if m.GetEnforcementMode() != nil { + cast := (*m.GetEnforcementMode()).String() + err := writer.WriteStringValue("enforcementMode", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("isEnabled", m.GetIsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("params", m.GetParams()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("scope", m.GetScope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uniqueName", m.GetUniqueName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyAssignment) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAssignedPolicy sets the assignedPolicy property value. The assignedPolicy property +func (m *ResourcePolicyAssignment) SetAssignedPolicy(value AssignedPolicyReferenceable) { + err := m.GetBackingStore().Set("assignedPolicy", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyAssignment) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetCreatedDateTime sets the createdDateTime property value. The createdDateTime property +func (m *ResourcePolicyAssignment) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDeletedDateTime sets the deletedDateTime property value. The deletedDateTime property +func (m *ResourcePolicyAssignment) SetDeletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("deletedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetEnforcementMode sets the enforcementMode property value. The enforcementMode property +func (m *ResourcePolicyAssignment) SetEnforcementMode(value *EnforcementMode) { + err := m.GetBackingStore().Set("enforcementMode", value) + if err != nil { + panic(err) + } +} + +// SetIsEnabled sets the isEnabled property value. The isEnabled property +func (m *ResourcePolicyAssignment) SetIsEnabled(value *bool) { + err := m.GetBackingStore().Set("isEnabled", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The lastModifiedDateTime property +func (m *ResourcePolicyAssignment) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ResourcePolicyAssignment) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetParams sets the params property value. The params property +func (m *ResourcePolicyAssignment) SetParams(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("params", value) + if err != nil { + panic(err) + } +} + +// SetScope sets the scope property value. The scope property +func (m *ResourcePolicyAssignment) SetScope(value *string) { + err := m.GetBackingStore().Set("scope", value) + if err != nil { + panic(err) + } +} + +// SetUniqueName sets the uniqueName property value. The uniqueName property +func (m *ResourcePolicyAssignment) SetUniqueName(value *string) { + err := m.GetBackingStore().Set("uniqueName", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignedPolicy() AssignedPolicyReferenceable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDeletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetEnforcementMode() *EnforcementMode + GetIsEnabled() *bool + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetParams() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetScope() *string + GetUniqueName() *string + SetAssignedPolicy(value AssignedPolicyReferenceable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDeletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetEnforcementMode(value *EnforcementMode) + SetIsEnabled(value *bool) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetParams(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetScope(value *string) + SetUniqueName(value *string) +} diff --git a/models/resource_policy_assignment_collection_response.go b/models/resource_policy_assignment_collection_response.go new file mode 100644 index 00000000000..a31b05ecb5a --- /dev/null +++ b/models/resource_policy_assignment_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ResourcePolicyAssignmentCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewResourcePolicyAssignmentCollectionResponse instantiates a new ResourcePolicyAssignmentCollectionResponse and sets the default values. +func NewResourcePolicyAssignmentCollectionResponse() *ResourcePolicyAssignmentCollectionResponse { + m := &ResourcePolicyAssignmentCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyAssignmentCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyAssignmentCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyAssignmentCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyAssignmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyAssignmentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyAssignmentable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ResourcePolicyAssignmentable when successful +func (m *ResourcePolicyAssignmentCollectionResponse) GetValue() []ResourcePolicyAssignmentable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyAssignmentable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyAssignmentCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ResourcePolicyAssignmentCollectionResponse) SetValue(value []ResourcePolicyAssignmentable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyAssignmentCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ResourcePolicyAssignmentable + SetValue(value []ResourcePolicyAssignmentable) +} diff --git a/models/resource_policy_configuration.go b/models/resource_policy_configuration.go new file mode 100644 index 00000000000..175c327bd95 --- /dev/null +++ b/models/resource_policy_configuration.go @@ -0,0 +1,120 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ResourcePolicyConfiguration struct { + Entity +} + +// NewResourcePolicyConfiguration instantiates a new ResourcePolicyConfiguration and sets the default values. +func NewResourcePolicyConfiguration() *ResourcePolicyConfiguration { + m := &ResourcePolicyConfiguration{ + Entity: *NewEntity(), + } + return m +} + +// CreateResourcePolicyConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyConfiguration(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["privilegedReadSetting"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePrivilegedReadSettingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPrivilegedReadSetting(val.(PrivilegedReadSettingable)) + } + return nil + } + return res +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The lastModifiedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyConfiguration) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetPrivilegedReadSetting gets the privilegedReadSetting property value. The privilegedReadSetting property +// returns a PrivilegedReadSettingable when successful +func (m *ResourcePolicyConfiguration) GetPrivilegedReadSetting() PrivilegedReadSettingable { + val, err := m.GetBackingStore().Get("privilegedReadSetting") + if err != nil { + panic(err) + } + if val != nil { + return val.(PrivilegedReadSettingable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteObjectValue("privilegedReadSetting", m.GetPrivilegedReadSetting()) + if err != nil { + return err + } + } + return nil +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The lastModifiedDateTime property +func (m *ResourcePolicyConfiguration) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetPrivilegedReadSetting sets the privilegedReadSetting property value. The privilegedReadSetting property +func (m *ResourcePolicyConfiguration) SetPrivilegedReadSetting(value PrivilegedReadSettingable) { + err := m.GetBackingStore().Set("privilegedReadSetting", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyConfigurationable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetPrivilegedReadSetting() PrivilegedReadSettingable + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetPrivilegedReadSetting(value PrivilegedReadSettingable) +} diff --git a/models/resource_policy_decision.go b/models/resource_policy_decision.go new file mode 100644 index 00000000000..3a7c2f9327a --- /dev/null +++ b/models/resource_policy_decision.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type ResourcePolicyDecision int + +const ( + DENY_RESOURCEPOLICYDECISION ResourcePolicyDecision = iota + NONE_RESOURCEPOLICYDECISION + COMPLIANT_RESOURCEPOLICYDECISION + UNKNOWNFUTUREVALUE_RESOURCEPOLICYDECISION +) + +func (i ResourcePolicyDecision) String() string { + return []string{"deny", "none", "compliant", "unknownFutureValue"}[i] +} + +func ParseResourcePolicyDecision(v string) (any, error) { + result := DENY_RESOURCEPOLICYDECISION + switch v { + case "deny": + result = DENY_RESOURCEPOLICYDECISION + case "none": + result = NONE_RESOURCEPOLICYDECISION + case "compliant": + result = COMPLIANT_RESOURCEPOLICYDECISION + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_RESOURCEPOLICYDECISION + default: + return nil, nil + } + return &result, nil +} + +func SerializeResourcePolicyDecision(values []ResourcePolicyDecision) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i ResourcePolicyDecision) isMultiValue() bool { + return false +} diff --git a/models/resource_policy_definition.go b/models/resource_policy_definition.go new file mode 100644 index 00000000000..cf7c9ffdb1f --- /dev/null +++ b/models/resource_policy_definition.go @@ -0,0 +1,578 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ResourcePolicyDefinition struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyDefinition instantiates a new ResourcePolicyDefinition and sets the default values. +func NewResourcePolicyDefinition() *ResourcePolicyDefinition { + m := &ResourcePolicyDefinition{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateResourcePolicyDefinitionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyDefinitionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyDefinition(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyDefinition) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAssignments gets the assignments property value. The assignments property +// returns a []ResourcePolicyAssignmentable when successful +func (m *ResourcePolicyDefinition) GetAssignments() []ResourcePolicyAssignmentable { + val, err := m.GetBackingStore().Get("assignments") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyAssignmentable) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyDefinition) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetCategory gets the category property value. The category property +// returns a *PolicyCategory when successful +func (m *ResourcePolicyDefinition) GetCategory() *PolicyCategory { + val, err := m.GetBackingStore().Get("category") + if err != nil { + panic(err) + } + if val != nil { + return val.(*PolicyCategory) + } + return nil +} + +// GetCreatedDateTime gets the createdDateTime property value. The createdDateTime property +// returns a *Time when successful +func (m *ResourcePolicyDefinition) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDeletedDateTime gets the deletedDateTime property value. The deletedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyDefinition) GetDeletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("deletedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *ResourcePolicyDefinition) GetDescription() *string { + val, err := m.GetBackingStore().Get("description") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayName gets the displayName property value. The displayName property +// returns a *string when successful +func (m *ResourcePolicyDefinition) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyDefinition) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["assignments"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyAssignmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyAssignmentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyAssignmentable) + } + } + m.SetAssignments(res) + } + return nil + } + res["category"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePolicyCategory) + if err != nil { + return err + } + if val != nil { + m.SetCategory(val.(*PolicyCategory)) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["deletedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletedDateTime(val) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["paramsSchema"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParamsSchema(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["previousVersions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyDefinitionVersionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyDefinitionVersionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyDefinitionVersionable) + } + } + m.SetPreviousVersions(res) + } + return nil + } + res["rule"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateResourcePolicyRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(ResourcePolicyRuleable)) + } + return nil + } + res["uniqueName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUniqueName(val) + } + return nil + } + res["version"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The lastModifiedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyDefinition) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ResourcePolicyDefinition) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetParamsSchema gets the paramsSchema property value. The paramsSchema property +// returns a UntypedNodeable when successful +func (m *ResourcePolicyDefinition) GetParamsSchema() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("paramsSchema") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetPreviousVersions gets the previousVersions property value. The previousVersions property +// returns a []ResourcePolicyDefinitionVersionable when successful +func (m *ResourcePolicyDefinition) GetPreviousVersions() []ResourcePolicyDefinitionVersionable { + val, err := m.GetBackingStore().Get("previousVersions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyDefinitionVersionable) + } + return nil +} + +// GetRule gets the rule property value. The rule property +// returns a ResourcePolicyRuleable when successful +func (m *ResourcePolicyDefinition) GetRule() ResourcePolicyRuleable { + val, err := m.GetBackingStore().Get("rule") + if err != nil { + panic(err) + } + if val != nil { + return val.(ResourcePolicyRuleable) + } + return nil +} + +// GetUniqueName gets the uniqueName property value. The uniqueName property +// returns a *string when successful +func (m *ResourcePolicyDefinition) GetUniqueName() *string { + val, err := m.GetBackingStore().Get("uniqueName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *ResourcePolicyDefinition) GetVersion() *string { + val, err := m.GetBackingStore().Get("version") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyDefinition) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetAssignments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignments())) + for i, v := range m.GetAssignments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignments", cast) + if err != nil { + return err + } + } + if m.GetCategory() != nil { + cast := (*m.GetCategory()).String() + err := writer.WriteStringValue("category", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetPreviousVersions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPreviousVersions())) + for i, v := range m.GetPreviousVersions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("previousVersions", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uniqueName", m.GetUniqueName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyDefinition) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAssignments sets the assignments property value. The assignments property +func (m *ResourcePolicyDefinition) SetAssignments(value []ResourcePolicyAssignmentable) { + err := m.GetBackingStore().Set("assignments", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyDefinition) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetCategory sets the category property value. The category property +func (m *ResourcePolicyDefinition) SetCategory(value *PolicyCategory) { + err := m.GetBackingStore().Set("category", value) + if err != nil { + panic(err) + } +} + +// SetCreatedDateTime sets the createdDateTime property value. The createdDateTime property +func (m *ResourcePolicyDefinition) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDeletedDateTime sets the deletedDateTime property value. The deletedDateTime property +func (m *ResourcePolicyDefinition) SetDeletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("deletedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDescription sets the description property value. The description property +func (m *ResourcePolicyDefinition) SetDescription(value *string) { + err := m.GetBackingStore().Set("description", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. The displayName property +func (m *ResourcePolicyDefinition) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The lastModifiedDateTime property +func (m *ResourcePolicyDefinition) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ResourcePolicyDefinition) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetParamsSchema sets the paramsSchema property value. The paramsSchema property +func (m *ResourcePolicyDefinition) SetParamsSchema(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("paramsSchema", value) + if err != nil { + panic(err) + } +} + +// SetPreviousVersions sets the previousVersions property value. The previousVersions property +func (m *ResourcePolicyDefinition) SetPreviousVersions(value []ResourcePolicyDefinitionVersionable) { + err := m.GetBackingStore().Set("previousVersions", value) + if err != nil { + panic(err) + } +} + +// SetRule sets the rule property value. The rule property +func (m *ResourcePolicyDefinition) SetRule(value ResourcePolicyRuleable) { + err := m.GetBackingStore().Set("rule", value) + if err != nil { + panic(err) + } +} + +// SetUniqueName sets the uniqueName property value. The uniqueName property +func (m *ResourcePolicyDefinition) SetUniqueName(value *string) { + err := m.GetBackingStore().Set("uniqueName", value) + if err != nil { + panic(err) + } +} + +// SetVersion sets the version property value. The version property +func (m *ResourcePolicyDefinition) SetVersion(value *string) { + err := m.GetBackingStore().Set("version", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyDefinitionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignments() []ResourcePolicyAssignmentable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetCategory() *PolicyCategory + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDeletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDescription() *string + GetDisplayName() *string + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetParamsSchema() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetPreviousVersions() []ResourcePolicyDefinitionVersionable + GetRule() ResourcePolicyRuleable + GetUniqueName() *string + GetVersion() *string + SetAssignments(value []ResourcePolicyAssignmentable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetCategory(value *PolicyCategory) + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDeletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDescription(value *string) + SetDisplayName(value *string) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetParamsSchema(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetPreviousVersions(value []ResourcePolicyDefinitionVersionable) + SetRule(value ResourcePolicyRuleable) + SetUniqueName(value *string) + SetVersion(value *string) +} diff --git a/models/resource_policy_definition_collection_response.go b/models/resource_policy_definition_collection_response.go new file mode 100644 index 00000000000..4cc49a126b9 --- /dev/null +++ b/models/resource_policy_definition_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ResourcePolicyDefinitionCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewResourcePolicyDefinitionCollectionResponse instantiates a new ResourcePolicyDefinitionCollectionResponse and sets the default values. +func NewResourcePolicyDefinitionCollectionResponse() *ResourcePolicyDefinitionCollectionResponse { + m := &ResourcePolicyDefinitionCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateResourcePolicyDefinitionCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyDefinitionCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyDefinitionCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyDefinitionCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyDefinitionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyDefinitionable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ResourcePolicyDefinitionable when successful +func (m *ResourcePolicyDefinitionCollectionResponse) GetValue() []ResourcePolicyDefinitionable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyDefinitionable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyDefinitionCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ResourcePolicyDefinitionCollectionResponse) SetValue(value []ResourcePolicyDefinitionable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyDefinitionCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ResourcePolicyDefinitionable + SetValue(value []ResourcePolicyDefinitionable) +} diff --git a/models/resource_policy_definition_version.go b/models/resource_policy_definition_version.go new file mode 100644 index 00000000000..b04a85a3e4e --- /dev/null +++ b/models/resource_policy_definition_version.go @@ -0,0 +1,259 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ResourcePolicyDefinitionVersion struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyDefinitionVersion instantiates a new ResourcePolicyDefinitionVersion and sets the default values. +func NewResourcePolicyDefinitionVersion() *ResourcePolicyDefinitionVersion { + m := &ResourcePolicyDefinitionVersion{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateResourcePolicyDefinitionVersionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyDefinitionVersionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyDefinitionVersion(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyDefinitionVersion) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyDefinitionVersion) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyDefinitionVersion) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["paramsSchema"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParamsSchema(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["policy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicy(val) + } + return nil + } + res["version"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. The lastModifiedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyDefinitionVersion) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ResourcePolicyDefinitionVersion) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetParamsSchema gets the paramsSchema property value. The paramsSchema property +// returns a UntypedNodeable when successful +func (m *ResourcePolicyDefinitionVersion) GetParamsSchema() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable { + val, err := m.GetBackingStore().Get("paramsSchema") + if err != nil { + panic(err) + } + if val != nil { + return val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + } + return nil +} + +// GetPolicy gets the policy property value. The policy property +// returns a *string when successful +func (m *ResourcePolicyDefinitionVersion) GetPolicy() *string { + val, err := m.GetBackingStore().Get("policy") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *ResourcePolicyDefinitionVersion) GetVersion() *string { + val, err := m.GetBackingStore().Get("version") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyDefinitionVersion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyDefinitionVersion) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyDefinitionVersion) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. The lastModifiedDateTime property +func (m *ResourcePolicyDefinitionVersion) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ResourcePolicyDefinitionVersion) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetParamsSchema sets the paramsSchema property value. The paramsSchema property +func (m *ResourcePolicyDefinitionVersion) SetParamsSchema(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + err := m.GetBackingStore().Set("paramsSchema", value) + if err != nil { + panic(err) + } +} + +// SetPolicy sets the policy property value. The policy property +func (m *ResourcePolicyDefinitionVersion) SetPolicy(value *string) { + err := m.GetBackingStore().Set("policy", value) + if err != nil { + panic(err) + } +} + +// SetVersion sets the version property value. The version property +func (m *ResourcePolicyDefinitionVersion) SetVersion(value *string) { + err := m.GetBackingStore().Set("version", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyDefinitionVersionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetParamsSchema() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + GetPolicy() *string + GetVersion() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetParamsSchema(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetPolicy(value *string) + SetVersion(value *string) +} diff --git a/models/resource_policy_definition_version_collection_response.go b/models/resource_policy_definition_version_collection_response.go new file mode 100644 index 00000000000..52fc667919b --- /dev/null +++ b/models/resource_policy_definition_version_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ResourcePolicyDefinitionVersionCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewResourcePolicyDefinitionVersionCollectionResponse instantiates a new ResourcePolicyDefinitionVersionCollectionResponse and sets the default values. +func NewResourcePolicyDefinitionVersionCollectionResponse() *ResourcePolicyDefinitionVersionCollectionResponse { + m := &ResourcePolicyDefinitionVersionCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateResourcePolicyDefinitionVersionCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyDefinitionVersionCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyDefinitionVersionCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyDefinitionVersionCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyDefinitionVersionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyDefinitionVersionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyDefinitionVersionable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ResourcePolicyDefinitionVersionable when successful +func (m *ResourcePolicyDefinitionVersionCollectionResponse) GetValue() []ResourcePolicyDefinitionVersionable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyDefinitionVersionable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyDefinitionVersionCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ResourcePolicyDefinitionVersionCollectionResponse) SetValue(value []ResourcePolicyDefinitionVersionable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyDefinitionVersionCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ResourcePolicyDefinitionVersionable + SetValue(value []ResourcePolicyDefinitionVersionable) +} diff --git a/models/resource_policy_deletable_root.go b/models/resource_policy_deletable_root.go new file mode 100644 index 00000000000..c236287783c --- /dev/null +++ b/models/resource_policy_deletable_root.go @@ -0,0 +1,149 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ResourcePolicyDeletableRoot struct { + Entity +} + +// NewResourcePolicyDeletableRoot instantiates a new ResourcePolicyDeletableRoot and sets the default values. +func NewResourcePolicyDeletableRoot() *ResourcePolicyDeletableRoot { + m := &ResourcePolicyDeletableRoot{ + Entity: *NewEntity(), + } + return m +} + +// CreateResourcePolicyDeletableRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyDeletableRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyDeletableRoot(), nil +} + +// GetAssignments gets the assignments property value. The assignments property +// returns a []ResourcePolicyAssignmentable when successful +func (m *ResourcePolicyDeletableRoot) GetAssignments() []ResourcePolicyAssignmentable { + val, err := m.GetBackingStore().Get("assignments") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyAssignmentable) + } + return nil +} + +// GetDefinitions gets the definitions property value. The definitions property +// returns a []ResourcePolicyDefinitionable when successful +func (m *ResourcePolicyDeletableRoot) GetDefinitions() []ResourcePolicyDefinitionable { + val, err := m.GetBackingStore().Get("definitions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyDefinitionable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyDeletableRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["assignments"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyAssignmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyAssignmentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyAssignmentable) + } + } + m.SetAssignments(res) + } + return nil + } + res["definitions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyDefinitionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyDefinitionable) + } + } + m.SetDefinitions(res) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *ResourcePolicyDeletableRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetAssignments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignments())) + for i, v := range m.GetAssignments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("assignments", cast) + if err != nil { + return err + } + } + if m.GetDefinitions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetDefinitions())) + for i, v := range m.GetDefinitions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("definitions", cast) + if err != nil { + return err + } + } + return nil +} + +// SetAssignments sets the assignments property value. The assignments property +func (m *ResourcePolicyDeletableRoot) SetAssignments(value []ResourcePolicyAssignmentable) { + err := m.GetBackingStore().Set("assignments", value) + if err != nil { + panic(err) + } +} + +// SetDefinitions sets the definitions property value. The definitions property +func (m *ResourcePolicyDeletableRoot) SetDefinitions(value []ResourcePolicyDefinitionable) { + err := m.GetBackingStore().Set("definitions", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyDeletableRootable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignments() []ResourcePolicyAssignmentable + GetDefinitions() []ResourcePolicyDefinitionable + SetAssignments(value []ResourcePolicyAssignmentable) + SetDefinitions(value []ResourcePolicyDefinitionable) +} diff --git a/models/resource_policy_evaluation_event.go b/models/resource_policy_evaluation_event.go new file mode 100644 index 00000000000..0ce58d3f1fc --- /dev/null +++ b/models/resource_policy_evaluation_event.go @@ -0,0 +1,1036 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +type ResourcePolicyEvaluationEvent struct { + Entity +} + +// NewResourcePolicyEvaluationEvent instantiates a new ResourcePolicyEvaluationEvent and sets the default values. +func NewResourcePolicyEvaluationEvent() *ResourcePolicyEvaluationEvent { + m := &ResourcePolicyEvaluationEvent{ + Entity: *NewEntity(), + } + return m +} + +// CreateResourcePolicyEvaluationEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyEvaluationEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyEvaluationEvent(), nil +} + +// GetApiVersion gets the apiVersion property value. The apiVersion property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetApiVersion() *string { + val, err := m.GetBackingStore().Get("apiVersion") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetAppDisplayName gets the appDisplayName property value. The appDisplayName property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetAppDisplayName() *string { + val, err := m.GetBackingStore().Get("appDisplayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetAppId gets the appId property value. The appId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetAppId() *string { + val, err := m.GetBackingStore().Get("appId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetApplicablePoliciesCount gets the applicablePoliciesCount property value. The applicablePoliciesCount property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetApplicablePoliciesCount() *int32 { + val, err := m.GetBackingStore().Get("applicablePoliciesCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetAuditPoliciesCount gets the auditPoliciesCount property value. The auditPoliciesCount property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetAuditPoliciesCount() *int32 { + val, err := m.GetBackingStore().Get("auditPoliciesCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetClientRequestId gets the clientRequestId property value. The clientRequestId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetClientRequestId() *string { + val, err := m.GetBackingStore().Get("clientRequestId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDenyPoliciesCount gets the denyPoliciesCount property value. The denyPoliciesCount property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetDenyPoliciesCount() *int32 { + val, err := m.GetBackingStore().Get("denyPoliciesCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetDurationMs gets the durationMs property value. The durationMs property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetDurationMs() *int32 { + val, err := m.GetBackingStore().Get("durationMs") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetErrorPoliciesCount gets the errorPoliciesCount property value. The errorPoliciesCount property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetErrorPoliciesCount() *int32 { + val, err := m.GetBackingStore().Get("errorPoliciesCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetEvaluatedDateTime gets the evaluatedDateTime property value. The evaluatedDateTime property +// returns a *Time when successful +func (m *ResourcePolicyEvaluationEvent) GetEvaluatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("evaluatedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetEvaluatedPoliciesCount gets the evaluatedPoliciesCount property value. The evaluatedPoliciesCount property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetEvaluatedPoliciesCount() *int32 { + val, err := m.GetBackingStore().Get("evaluatedPoliciesCount") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyEvaluationEvent) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["apiVersion"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetApiVersion(val) + } + return nil + } + res["appDisplayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppDisplayName(val) + } + return nil + } + res["appId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["applicablePoliciesCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetApplicablePoliciesCount(val) + } + return nil + } + res["auditPoliciesCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAuditPoliciesCount(val) + } + return nil + } + res["clientRequestId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientRequestId(val) + } + return nil + } + res["denyPoliciesCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDenyPoliciesCount(val) + } + return nil + } + res["durationMs"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDurationMs(val) + } + return nil + } + res["errorPoliciesCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetErrorPoliciesCount(val) + } + return nil + } + res["evaluatedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetEvaluatedDateTime(val) + } + return nil + } + res["evaluatedPoliciesCount"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEvaluatedPoliciesCount(val) + } + return nil + } + res["location"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["operationId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOperationId(val) + } + return nil + } + res["policyDecision"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseResourcePolicyDecision) + if err != nil { + return err + } + if val != nil { + m.SetPolicyDecision(val.(*ResourcePolicyDecision)) + } + return nil + } + res["policyDetails"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePolicyEvaluationDetailFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PolicyEvaluationDetailable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PolicyEvaluationDetailable) + } + } + m.SetPolicyDetails(res) + } + return nil + } + res["requestId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRequestId(val) + } + return nil + } + res["requestMethod"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRequestMethod(val) + } + return nil + } + res["requestUri"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRequestUri(val) + } + return nil + } + res["servicePrincipalId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServicePrincipalId(val) + } + return nil + } + res["targetResourceId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetResourceId(val) + } + return nil + } + res["targetResourceName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetResourceName(val) + } + return nil + } + res["tenantId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTenantId(val) + } + return nil + } + res["totalFetchDurationMs"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalFetchDurationMs(val) + } + return nil + } + res["totalPolicyEvaluationDurationMs"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPolicyEvaluationDurationMs(val) + } + return nil + } + res["userId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserId(val) + } + return nil + } + return res +} + +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetLocation() *string { + val, err := m.GetBackingStore().Get("location") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOperationId gets the operationId property value. The operationId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetOperationId() *string { + val, err := m.GetBackingStore().Get("operationId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPolicyDecision gets the policyDecision property value. The policyDecision property +// returns a *ResourcePolicyDecision when successful +func (m *ResourcePolicyEvaluationEvent) GetPolicyDecision() *ResourcePolicyDecision { + val, err := m.GetBackingStore().Get("policyDecision") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ResourcePolicyDecision) + } + return nil +} + +// GetPolicyDetails gets the policyDetails property value. The policyDetails property +// returns a []PolicyEvaluationDetailable when successful +func (m *ResourcePolicyEvaluationEvent) GetPolicyDetails() []PolicyEvaluationDetailable { + val, err := m.GetBackingStore().Get("policyDetails") + if err != nil { + panic(err) + } + if val != nil { + return val.([]PolicyEvaluationDetailable) + } + return nil +} + +// GetRequestId gets the requestId property value. The requestId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetRequestId() *string { + val, err := m.GetBackingStore().Get("requestId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetRequestMethod gets the requestMethod property value. The requestMethod property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetRequestMethod() *string { + val, err := m.GetBackingStore().Get("requestMethod") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetRequestUri gets the requestUri property value. The requestUri property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetRequestUri() *string { + val, err := m.GetBackingStore().Get("requestUri") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetServicePrincipalId gets the servicePrincipalId property value. The servicePrincipalId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetServicePrincipalId() *string { + val, err := m.GetBackingStore().Get("servicePrincipalId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTargetResourceId gets the targetResourceId property value. The targetResourceId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetTargetResourceId() *string { + val, err := m.GetBackingStore().Get("targetResourceId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTargetResourceName gets the targetResourceName property value. The targetResourceName property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetTargetResourceName() *string { + val, err := m.GetBackingStore().Get("targetResourceName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTenantId gets the tenantId property value. The tenantId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetTenantId() *string { + val, err := m.GetBackingStore().Get("tenantId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTotalFetchDurationMs gets the totalFetchDurationMs property value. The totalFetchDurationMs property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetTotalFetchDurationMs() *int32 { + val, err := m.GetBackingStore().Get("totalFetchDurationMs") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetTotalPolicyEvaluationDurationMs gets the totalPolicyEvaluationDurationMs property value. The totalPolicyEvaluationDurationMs property +// returns a *int32 when successful +func (m *ResourcePolicyEvaluationEvent) GetTotalPolicyEvaluationDurationMs() *int32 { + val, err := m.GetBackingStore().Get("totalPolicyEvaluationDurationMs") + if err != nil { + panic(err) + } + if val != nil { + return val.(*int32) + } + return nil +} + +// GetUserId gets the userId property value. The userId property +// returns a *string when successful +func (m *ResourcePolicyEvaluationEvent) GetUserId() *string { + val, err := m.GetBackingStore().Get("userId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyEvaluationEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("apiVersion", m.GetApiVersion()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("appDisplayName", m.GetAppDisplayName()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("appId", m.GetAppId()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("applicablePoliciesCount", m.GetApplicablePoliciesCount()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("auditPoliciesCount", m.GetAuditPoliciesCount()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("clientRequestId", m.GetClientRequestId()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("denyPoliciesCount", m.GetDenyPoliciesCount()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("durationMs", m.GetDurationMs()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("errorPoliciesCount", m.GetErrorPoliciesCount()) + if err != nil { + return err + } + } + { + err = writer.WriteTimeValue("evaluatedDateTime", m.GetEvaluatedDateTime()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("evaluatedPoliciesCount", m.GetEvaluatedPoliciesCount()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("operationId", m.GetOperationId()) + if err != nil { + return err + } + } + if m.GetPolicyDecision() != nil { + cast := (*m.GetPolicyDecision()).String() + err = writer.WriteStringValue("policyDecision", &cast) + if err != nil { + return err + } + } + if m.GetPolicyDetails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPolicyDetails())) + for i, v := range m.GetPolicyDetails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("policyDetails", cast) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("requestId", m.GetRequestId()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("requestMethod", m.GetRequestMethod()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("requestUri", m.GetRequestUri()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("servicePrincipalId", m.GetServicePrincipalId()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("targetResourceId", m.GetTargetResourceId()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("targetResourceName", m.GetTargetResourceName()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("tenantId", m.GetTenantId()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("totalFetchDurationMs", m.GetTotalFetchDurationMs()) + if err != nil { + return err + } + } + { + err = writer.WriteInt32Value("totalPolicyEvaluationDurationMs", m.GetTotalPolicyEvaluationDurationMs()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("userId", m.GetUserId()) + if err != nil { + return err + } + } + return nil +} + +// SetApiVersion sets the apiVersion property value. The apiVersion property +func (m *ResourcePolicyEvaluationEvent) SetApiVersion(value *string) { + err := m.GetBackingStore().Set("apiVersion", value) + if err != nil { + panic(err) + } +} + +// SetAppDisplayName sets the appDisplayName property value. The appDisplayName property +func (m *ResourcePolicyEvaluationEvent) SetAppDisplayName(value *string) { + err := m.GetBackingStore().Set("appDisplayName", value) + if err != nil { + panic(err) + } +} + +// SetAppId sets the appId property value. The appId property +func (m *ResourcePolicyEvaluationEvent) SetAppId(value *string) { + err := m.GetBackingStore().Set("appId", value) + if err != nil { + panic(err) + } +} + +// SetApplicablePoliciesCount sets the applicablePoliciesCount property value. The applicablePoliciesCount property +func (m *ResourcePolicyEvaluationEvent) SetApplicablePoliciesCount(value *int32) { + err := m.GetBackingStore().Set("applicablePoliciesCount", value) + if err != nil { + panic(err) + } +} + +// SetAuditPoliciesCount sets the auditPoliciesCount property value. The auditPoliciesCount property +func (m *ResourcePolicyEvaluationEvent) SetAuditPoliciesCount(value *int32) { + err := m.GetBackingStore().Set("auditPoliciesCount", value) + if err != nil { + panic(err) + } +} + +// SetClientRequestId sets the clientRequestId property value. The clientRequestId property +func (m *ResourcePolicyEvaluationEvent) SetClientRequestId(value *string) { + err := m.GetBackingStore().Set("clientRequestId", value) + if err != nil { + panic(err) + } +} + +// SetDenyPoliciesCount sets the denyPoliciesCount property value. The denyPoliciesCount property +func (m *ResourcePolicyEvaluationEvent) SetDenyPoliciesCount(value *int32) { + err := m.GetBackingStore().Set("denyPoliciesCount", value) + if err != nil { + panic(err) + } +} + +// SetDurationMs sets the durationMs property value. The durationMs property +func (m *ResourcePolicyEvaluationEvent) SetDurationMs(value *int32) { + err := m.GetBackingStore().Set("durationMs", value) + if err != nil { + panic(err) + } +} + +// SetErrorPoliciesCount sets the errorPoliciesCount property value. The errorPoliciesCount property +func (m *ResourcePolicyEvaluationEvent) SetErrorPoliciesCount(value *int32) { + err := m.GetBackingStore().Set("errorPoliciesCount", value) + if err != nil { + panic(err) + } +} + +// SetEvaluatedDateTime sets the evaluatedDateTime property value. The evaluatedDateTime property +func (m *ResourcePolicyEvaluationEvent) SetEvaluatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("evaluatedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetEvaluatedPoliciesCount sets the evaluatedPoliciesCount property value. The evaluatedPoliciesCount property +func (m *ResourcePolicyEvaluationEvent) SetEvaluatedPoliciesCount(value *int32) { + err := m.GetBackingStore().Set("evaluatedPoliciesCount", value) + if err != nil { + panic(err) + } +} + +// SetLocation sets the location property value. The location property +func (m *ResourcePolicyEvaluationEvent) SetLocation(value *string) { + err := m.GetBackingStore().Set("location", value) + if err != nil { + panic(err) + } +} + +// SetOperationId sets the operationId property value. The operationId property +func (m *ResourcePolicyEvaluationEvent) SetOperationId(value *string) { + err := m.GetBackingStore().Set("operationId", value) + if err != nil { + panic(err) + } +} + +// SetPolicyDecision sets the policyDecision property value. The policyDecision property +func (m *ResourcePolicyEvaluationEvent) SetPolicyDecision(value *ResourcePolicyDecision) { + err := m.GetBackingStore().Set("policyDecision", value) + if err != nil { + panic(err) + } +} + +// SetPolicyDetails sets the policyDetails property value. The policyDetails property +func (m *ResourcePolicyEvaluationEvent) SetPolicyDetails(value []PolicyEvaluationDetailable) { + err := m.GetBackingStore().Set("policyDetails", value) + if err != nil { + panic(err) + } +} + +// SetRequestId sets the requestId property value. The requestId property +func (m *ResourcePolicyEvaluationEvent) SetRequestId(value *string) { + err := m.GetBackingStore().Set("requestId", value) + if err != nil { + panic(err) + } +} + +// SetRequestMethod sets the requestMethod property value. The requestMethod property +func (m *ResourcePolicyEvaluationEvent) SetRequestMethod(value *string) { + err := m.GetBackingStore().Set("requestMethod", value) + if err != nil { + panic(err) + } +} + +// SetRequestUri sets the requestUri property value. The requestUri property +func (m *ResourcePolicyEvaluationEvent) SetRequestUri(value *string) { + err := m.GetBackingStore().Set("requestUri", value) + if err != nil { + panic(err) + } +} + +// SetServicePrincipalId sets the servicePrincipalId property value. The servicePrincipalId property +func (m *ResourcePolicyEvaluationEvent) SetServicePrincipalId(value *string) { + err := m.GetBackingStore().Set("servicePrincipalId", value) + if err != nil { + panic(err) + } +} + +// SetTargetResourceId sets the targetResourceId property value. The targetResourceId property +func (m *ResourcePolicyEvaluationEvent) SetTargetResourceId(value *string) { + err := m.GetBackingStore().Set("targetResourceId", value) + if err != nil { + panic(err) + } +} + +// SetTargetResourceName sets the targetResourceName property value. The targetResourceName property +func (m *ResourcePolicyEvaluationEvent) SetTargetResourceName(value *string) { + err := m.GetBackingStore().Set("targetResourceName", value) + if err != nil { + panic(err) + } +} + +// SetTenantId sets the tenantId property value. The tenantId property +func (m *ResourcePolicyEvaluationEvent) SetTenantId(value *string) { + err := m.GetBackingStore().Set("tenantId", value) + if err != nil { + panic(err) + } +} + +// SetTotalFetchDurationMs sets the totalFetchDurationMs property value. The totalFetchDurationMs property +func (m *ResourcePolicyEvaluationEvent) SetTotalFetchDurationMs(value *int32) { + err := m.GetBackingStore().Set("totalFetchDurationMs", value) + if err != nil { + panic(err) + } +} + +// SetTotalPolicyEvaluationDurationMs sets the totalPolicyEvaluationDurationMs property value. The totalPolicyEvaluationDurationMs property +func (m *ResourcePolicyEvaluationEvent) SetTotalPolicyEvaluationDurationMs(value *int32) { + err := m.GetBackingStore().Set("totalPolicyEvaluationDurationMs", value) + if err != nil { + panic(err) + } +} + +// SetUserId sets the userId property value. The userId property +func (m *ResourcePolicyEvaluationEvent) SetUserId(value *string) { + err := m.GetBackingStore().Set("userId", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyEvaluationEventable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApiVersion() *string + GetAppDisplayName() *string + GetAppId() *string + GetApplicablePoliciesCount() *int32 + GetAuditPoliciesCount() *int32 + GetClientRequestId() *string + GetDenyPoliciesCount() *int32 + GetDurationMs() *int32 + GetErrorPoliciesCount() *int32 + GetEvaluatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetEvaluatedPoliciesCount() *int32 + GetLocation() *string + GetOperationId() *string + GetPolicyDecision() *ResourcePolicyDecision + GetPolicyDetails() []PolicyEvaluationDetailable + GetRequestId() *string + GetRequestMethod() *string + GetRequestUri() *string + GetServicePrincipalId() *string + GetTargetResourceId() *string + GetTargetResourceName() *string + GetTenantId() *string + GetTotalFetchDurationMs() *int32 + GetTotalPolicyEvaluationDurationMs() *int32 + GetUserId() *string + SetApiVersion(value *string) + SetAppDisplayName(value *string) + SetAppId(value *string) + SetApplicablePoliciesCount(value *int32) + SetAuditPoliciesCount(value *int32) + SetClientRequestId(value *string) + SetDenyPoliciesCount(value *int32) + SetDurationMs(value *int32) + SetErrorPoliciesCount(value *int32) + SetEvaluatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetEvaluatedPoliciesCount(value *int32) + SetLocation(value *string) + SetOperationId(value *string) + SetPolicyDecision(value *ResourcePolicyDecision) + SetPolicyDetails(value []PolicyEvaluationDetailable) + SetRequestId(value *string) + SetRequestMethod(value *string) + SetRequestUri(value *string) + SetServicePrincipalId(value *string) + SetTargetResourceId(value *string) + SetTargetResourceName(value *string) + SetTenantId(value *string) + SetTotalFetchDurationMs(value *int32) + SetTotalPolicyEvaluationDurationMs(value *int32) + SetUserId(value *string) +} diff --git a/models/resource_policy_evaluation_event_collection_response.go b/models/resource_policy_evaluation_event_collection_response.go new file mode 100644 index 00000000000..c21b673ac51 --- /dev/null +++ b/models/resource_policy_evaluation_event_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ResourcePolicyEvaluationEventCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewResourcePolicyEvaluationEventCollectionResponse instantiates a new ResourcePolicyEvaluationEventCollectionResponse and sets the default values. +func NewResourcePolicyEvaluationEventCollectionResponse() *ResourcePolicyEvaluationEventCollectionResponse { + m := &ResourcePolicyEvaluationEventCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateResourcePolicyEvaluationEventCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyEvaluationEventCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyEvaluationEventCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyEvaluationEventCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyEvaluationEventFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyEvaluationEventable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyEvaluationEventable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ResourcePolicyEvaluationEventable when successful +func (m *ResourcePolicyEvaluationEventCollectionResponse) GetValue() []ResourcePolicyEvaluationEventable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyEvaluationEventable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyEvaluationEventCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ResourcePolicyEvaluationEventCollectionResponse) SetValue(value []ResourcePolicyEvaluationEventable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyEvaluationEventCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ResourcePolicyEvaluationEventable + SetValue(value []ResourcePolicyEvaluationEventable) +} diff --git a/models/resource_policy_root.go b/models/resource_policy_root.go new file mode 100644 index 00000000000..b66e159601a --- /dev/null +++ b/models/resource_policy_root.go @@ -0,0 +1,278 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ResourcePolicyRoot struct { + Entity +} + +// NewResourcePolicyRoot instantiates a new ResourcePolicyRoot and sets the default values. +func NewResourcePolicyRoot() *ResourcePolicyRoot { + m := &ResourcePolicyRoot{ + Entity: *NewEntity(), + } + return m +} + +// CreateResourcePolicyRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyRoot(), nil +} + +// GetAssignments gets the assignments property value. The assignments property +// returns a []ResourcePolicyAssignmentable when successful +func (m *ResourcePolicyRoot) GetAssignments() []ResourcePolicyAssignmentable { + val, err := m.GetBackingStore().Get("assignments") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyAssignmentable) + } + return nil +} + +// GetBuiltInDefinitions gets the builtInDefinitions property value. The builtInDefinitions property +// returns a []ResourcePolicyDefinitionable when successful +func (m *ResourcePolicyRoot) GetBuiltInDefinitions() []ResourcePolicyDefinitionable { + val, err := m.GetBackingStore().Get("builtInDefinitions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyDefinitionable) + } + return nil +} + +// GetConfiguration gets the configuration property value. The configuration property +// returns a ResourcePolicyConfigurationable when successful +func (m *ResourcePolicyRoot) GetConfiguration() ResourcePolicyConfigurationable { + val, err := m.GetBackingStore().Get("configuration") + if err != nil { + panic(err) + } + if val != nil { + return val.(ResourcePolicyConfigurationable) + } + return nil +} + +// GetDefinitions gets the definitions property value. The definitions property +// returns a []ResourcePolicyDefinitionable when successful +func (m *ResourcePolicyRoot) GetDefinitions() []ResourcePolicyDefinitionable { + val, err := m.GetBackingStore().Get("definitions") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ResourcePolicyDefinitionable) + } + return nil +} + +// GetDeletedItems gets the deletedItems property value. The deletedItems property +// returns a ResourcePolicyDeletableRootable when successful +func (m *ResourcePolicyRoot) GetDeletedItems() ResourcePolicyDeletableRootable { + val, err := m.GetBackingStore().Get("deletedItems") + if err != nil { + panic(err) + } + if val != nil { + return val.(ResourcePolicyDeletableRootable) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyRoot) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["assignments"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyAssignmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyAssignmentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyAssignmentable) + } + } + m.SetAssignments(res) + } + return nil + } + res["builtInDefinitions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyDefinitionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyDefinitionable) + } + } + m.SetBuiltInDefinitions(res) + } + return nil + } + res["configuration"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateResourcePolicyConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfiguration(val.(ResourcePolicyConfigurationable)) + } + return nil + } + res["definitions"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateResourcePolicyDefinitionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ResourcePolicyDefinitionable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ResourcePolicyDefinitionable) + } + } + m.SetDefinitions(res) + } + return nil + } + res["deletedItems"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateResourcePolicyDeletableRootFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeletedItems(val.(ResourcePolicyDeletableRootable)) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *ResourcePolicyRoot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetAssignments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignments())) + for i, v := range m.GetAssignments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("assignments", cast) + if err != nil { + return err + } + } + if m.GetBuiltInDefinitions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBuiltInDefinitions())) + for i, v := range m.GetBuiltInDefinitions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("builtInDefinitions", cast) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("configuration", m.GetConfiguration()) + if err != nil { + return err + } + } + if m.GetDefinitions() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetDefinitions())) + for i, v := range m.GetDefinitions() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("definitions", cast) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("deletedItems", m.GetDeletedItems()) + if err != nil { + return err + } + } + return nil +} + +// SetAssignments sets the assignments property value. The assignments property +func (m *ResourcePolicyRoot) SetAssignments(value []ResourcePolicyAssignmentable) { + err := m.GetBackingStore().Set("assignments", value) + if err != nil { + panic(err) + } +} + +// SetBuiltInDefinitions sets the builtInDefinitions property value. The builtInDefinitions property +func (m *ResourcePolicyRoot) SetBuiltInDefinitions(value []ResourcePolicyDefinitionable) { + err := m.GetBackingStore().Set("builtInDefinitions", value) + if err != nil { + panic(err) + } +} + +// SetConfiguration sets the configuration property value. The configuration property +func (m *ResourcePolicyRoot) SetConfiguration(value ResourcePolicyConfigurationable) { + err := m.GetBackingStore().Set("configuration", value) + if err != nil { + panic(err) + } +} + +// SetDefinitions sets the definitions property value. The definitions property +func (m *ResourcePolicyRoot) SetDefinitions(value []ResourcePolicyDefinitionable) { + err := m.GetBackingStore().Set("definitions", value) + if err != nil { + panic(err) + } +} + +// SetDeletedItems sets the deletedItems property value. The deletedItems property +func (m *ResourcePolicyRoot) SetDeletedItems(value ResourcePolicyDeletableRootable) { + err := m.GetBackingStore().Set("deletedItems", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyRootable interface { + Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignments() []ResourcePolicyAssignmentable + GetBuiltInDefinitions() []ResourcePolicyDefinitionable + GetConfiguration() ResourcePolicyConfigurationable + GetDefinitions() []ResourcePolicyDefinitionable + GetDeletedItems() ResourcePolicyDeletableRootable + SetAssignments(value []ResourcePolicyAssignmentable) + SetBuiltInDefinitions(value []ResourcePolicyDefinitionable) + SetConfiguration(value ResourcePolicyConfigurationable) + SetDefinitions(value []ResourcePolicyDefinitionable) + SetDeletedItems(value ResourcePolicyDeletableRootable) +} diff --git a/models/resource_policy_rule.go b/models/resource_policy_rule.go new file mode 100644 index 00000000000..7c60a001476 --- /dev/null +++ b/models/resource_policy_rule.go @@ -0,0 +1,198 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ResourcePolicyRule struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewResourcePolicyRule instantiates a new ResourcePolicyRule and sets the default values. +func NewResourcePolicyRule() *ResourcePolicyRule { + m := &ResourcePolicyRule{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateResourcePolicyRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateResourcePolicyRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewResourcePolicyRule(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ResourcePolicyRule) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAppliesTo gets the appliesTo property value. The appliesTo property +// returns a PolicyAppliesToable when successful +func (m *ResourcePolicyRule) GetAppliesTo() PolicyAppliesToable { + val, err := m.GetBackingStore().Get("appliesTo") + if err != nil { + panic(err) + } + if val != nil { + return val.(PolicyAppliesToable) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ResourcePolicyRule) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ResourcePolicyRule) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["appliesTo"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePolicyAppliesToFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAppliesTo(val.(PolicyAppliesToable)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["policy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPolicy(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *ResourcePolicyRule) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetPolicy gets the policy property value. The policy property +// returns a *string when successful +func (m *ResourcePolicyRule) GetPolicy() *string { + val, err := m.GetBackingStore().Get("policy") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ResourcePolicyRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("policy", m.GetPolicy()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ResourcePolicyRule) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAppliesTo sets the appliesTo property value. The appliesTo property +func (m *ResourcePolicyRule) SetAppliesTo(value PolicyAppliesToable) { + err := m.GetBackingStore().Set("appliesTo", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ResourcePolicyRule) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *ResourcePolicyRule) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetPolicy sets the policy property value. The policy property +func (m *ResourcePolicyRule) SetPolicy(value *string) { + err := m.GetBackingStore().Set("policy", value) + if err != nil { + panic(err) + } +} + +type ResourcePolicyRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppliesTo() PolicyAppliesToable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetPolicy() *string + SetAppliesTo(value PolicyAppliesToable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetPolicy(value *string) +} diff --git a/models/resource_quota.go b/models/resource_quota.go index deab20d51d5..70ce2356901 100644 --- a/models/resource_quota.go +++ b/models/resource_quota.go @@ -94,7 +94,7 @@ func (m *ResourceQuota) GetFieldDeserializers() map[string]func(i878a80d2330e89d return res } -// GetMaxPercentage gets the maxPercentage property value. The maxPercentage property +// GetMaxPercentage gets the maxPercentage property value. The maximum percentage of the organization's directorySizeQuota.total that this resource type can consume. The value must be between 0 and 100. A value of 0 blocks creation of new resources of this type. If omitted for supported resource types, the default is 80. // returns a *int32 when successful func (m *ResourceQuota) GetMaxPercentage() *int32 { val, err := m.GetBackingStore().Get("maxPercentage") @@ -133,7 +133,7 @@ func (m *ResourceQuota) GetResourceType() *ResourceQuotaType { return nil } -// GetTotal gets the total property value. The total property +// GetTotal gets the total property value. The effective maximum number of resources allowed, calculated from directorySizeQuota.total and maxPercentage. This value is read-only and changes when the organization's overall quota changes. // returns a *int32 when successful func (m *ResourceQuota) GetTotal() *int32 { val, err := m.GetBackingStore().Get("total") @@ -195,7 +195,7 @@ func (m *ResourceQuota) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41 m.backingStore = value } -// SetMaxPercentage sets the maxPercentage property value. The maxPercentage property +// SetMaxPercentage sets the maxPercentage property value. The maximum percentage of the organization's directorySizeQuota.total that this resource type can consume. The value must be between 0 and 100. A value of 0 blocks creation of new resources of this type. If omitted for supported resource types, the default is 80. func (m *ResourceQuota) SetMaxPercentage(value *int32) { err := m.GetBackingStore().Set("maxPercentage", value) if err != nil { @@ -219,7 +219,7 @@ func (m *ResourceQuota) SetResourceType(value *ResourceQuotaType) { } } -// SetTotal sets the total property value. The total property +// SetTotal sets the total property value. The effective maximum number of resources allowed, calculated from directorySizeQuota.total and maxPercentage. This value is read-only and changes when the organization's overall quota changes. func (m *ResourceQuota) SetTotal(value *int32) { err := m.GetBackingStore().Set("total", value) if err != nil { diff --git a/models/retention_setting.go b/models/retention_setting.go index d2767b1d22a..091da7e8205 100644 --- a/models/retention_setting.go +++ b/models/retention_setting.go @@ -84,7 +84,7 @@ func (m *RetentionSetting) GetFieldDeserializers() map[string]func(i878a80d2330e return res } -// GetInterval gets the interval property value. The frequency of the backup. +// GetInterval gets the interval property value. The backup frequency, expressed as an ISO 8601 repeating interval. The service defines the backup intervals: R/PT10M for 10-minute copies and R/P1W for weekly copies. Use R/P1W when specifying the policy retention period in a create or update request. // returns a *string when successful func (m *RetentionSetting) GetInterval() *string { val, err := m.GetBackingStore().Get("interval") @@ -110,7 +110,7 @@ func (m *RetentionSetting) GetOdataType() *string { return nil } -// GetPeriod gets the period property value. The period of time to retain the protected data for a single Microsoft 365 service. The possible values are: P90D, P180D, P365D, P730D, P1095D, P1460D, P1825D, P2190D, P2555D, P2920D, P3285D, and P3650D. Other values aren't supported. +// GetPeriod gets the period property value. The period of time to retain the protected data for a single Microsoft 365 service, expressed as an ISO 8601 duration. The supported policy retention periods in create and update requests are: P90D, P180D, P365D, P730D, P1095D, P1460D, P1825D, P2190D, P2555D, P2920D, P3285D, and P3650D. Other policy retention periods aren't supported. // returns a *ISODuration when successful func (m *RetentionSetting) GetPeriod() *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ISODuration { val, err := m.GetBackingStore().Get("period") @@ -165,7 +165,7 @@ func (m *RetentionSetting) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078 m.backingStore = value } -// SetInterval sets the interval property value. The frequency of the backup. +// SetInterval sets the interval property value. The backup frequency, expressed as an ISO 8601 repeating interval. The service defines the backup intervals: R/PT10M for 10-minute copies and R/P1W for weekly copies. Use R/P1W when specifying the policy retention period in a create or update request. func (m *RetentionSetting) SetInterval(value *string) { err := m.GetBackingStore().Set("interval", value) if err != nil { @@ -181,7 +181,7 @@ func (m *RetentionSetting) SetOdataType(value *string) { } } -// SetPeriod sets the period property value. The period of time to retain the protected data for a single Microsoft 365 service. The possible values are: P90D, P180D, P365D, P730D, P1095D, P1460D, P1825D, P2190D, P2555D, P2920D, P3285D, and P3650D. Other values aren't supported. +// SetPeriod sets the period property value. The period of time to retain the protected data for a single Microsoft 365 service, expressed as an ISO 8601 duration. The supported policy retention periods in create and update requests are: P90D, P180D, P365D, P730D, P1095D, P1460D, P1825D, P2190D, P2555D, P2920D, P3285D, and P3650D. Other policy retention periods aren't supported. func (m *RetentionSetting) SetPeriod(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ISODuration) { err := m.GetBackingStore().Set("period", value) if err != nil { diff --git a/models/saml_identifier_uri_configuration.go b/models/saml_identifier_uri_configuration.go new file mode 100644 index 00000000000..81201c30fbe --- /dev/null +++ b/models/saml_identifier_uri_configuration.go @@ -0,0 +1,172 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// SamlIdentifierUriConfiguration identifier URIs classified for the SAML protocol. Each value must also exist in the application's top-level identifierUris. Clearing this classification doesn't remove top-level identifierUris; complete deletion requires removing the URI from identifierUris and every referencing protocol classification in the same Application PATCH. No extra SAML-specific format rules beyond existing identifierUris validation. +type SamlIdentifierUriConfiguration struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewSamlIdentifierUriConfiguration instantiates a new SamlIdentifierUriConfiguration and sets the default values. +func NewSamlIdentifierUriConfiguration() *SamlIdentifierUriConfiguration { + m := &SamlIdentifierUriConfiguration{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateSamlIdentifierUriConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSamlIdentifierUriConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSamlIdentifierUriConfiguration(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *SamlIdentifierUriConfiguration) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *SamlIdentifierUriConfiguration) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *SamlIdentifierUriConfiguration) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["uris"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetUris(res) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *SamlIdentifierUriConfiguration) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUris gets the uris property value. Required and non-null when SAML identifier URI configuration is supplied. Application identifier URIs classified for SAML. Must be a subset of top-level identifierUris in the prospective final state. An empty collection normalizes the parent to null without changing top-level identifierUris. +// returns a []string when successful +func (m *SamlIdentifierUriConfiguration) GetUris() []string { + val, err := m.GetBackingStore().Get("uris") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// Serialize serializes information the current object +func (m *SamlIdentifierUriConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetUris() != nil { + err := writer.WriteCollectionOfStringValues("uris", m.GetUris()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SamlIdentifierUriConfiguration) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *SamlIdentifierUriConfiguration) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *SamlIdentifierUriConfiguration) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetUris sets the uris property value. Required and non-null when SAML identifier URI configuration is supplied. Application identifier URIs classified for SAML. Must be a subset of top-level identifierUris in the prospective final state. An empty collection normalizes the parent to null without changing top-level identifierUris. +func (m *SamlIdentifierUriConfiguration) SetUris(value []string) { + err := m.GetBackingStore().Set("uris", value) + if err != nil { + panic(err) + } +} + +type SamlIdentifierUriConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetUris() []string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetUris(value []string) +} diff --git a/models/security.go b/models/security.go index 899d3123ae9..ff8666b0558 100644 --- a/models/security.go +++ b/models/security.go @@ -41,6 +41,19 @@ func (m *Security) GetAdditionalData() map[string]any { return val.(map[string]any) } +// GetAgenticSecurity gets the agenticSecurity property value. The agenticSecurity property +// returns a AgenticSecurityRootable when successful +func (m *Security) GetAgenticSecurity() AgenticSecurityRootable { + val, err := m.GetBackingStore().Get("agenticSecurity") + if err != nil { + panic(err) + } + if val != nil { + return val.(AgenticSecurityRootable) + } + return nil +} + // GetAlerts gets the alerts property value. Notifications for suspicious or potential security issues in a customer's tenant. // returns a []Alertable when successful func (m *Security) GetAlerts() []Alertable { @@ -86,6 +99,19 @@ func (m *Security) GetCloudAppSecurityProfiles() []CloudAppSecurityProfileable { return nil } +// GetContentManagement gets the contentManagement property value. The contentManagement property +// returns a ContentManagementRootable when successful +func (m *Security) GetContentManagement() ContentManagementRootable { + val, err := m.GetBackingStore().Get("contentManagement") + if err != nil { + panic(err) + } + if val != nil { + return val.(ContentManagementRootable) + } + return nil +} + // GetDataSecurityAndGovernance gets the dataSecurityAndGovernance property value. The dataSecurityAndGovernance property // returns a TenantDataSecurityAndGovernanceable when successful func (m *Security) GetDataSecurityAndGovernance() TenantDataSecurityAndGovernanceable { @@ -116,6 +142,16 @@ func (m *Security) GetDomainSecurityProfiles() []DomainSecurityProfileable { // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful func (m *Security) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["agenticSecurity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAgenticSecurityRootFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAgenticSecurity(val.(AgenticSecurityRootable)) + } + return nil + } res["alerts"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateAlertFromDiscriminatorValue) if err != nil { @@ -158,6 +194,16 @@ func (m *Security) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896 } return nil } + res["contentManagement"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentManagementRootFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContentManagement(val.(ContentManagementRootable)) + } + return nil + } res["dataSecurityAndGovernance"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateTenantDataSecurityAndGovernanceFromDiscriminatorValue) if err != nil { @@ -525,6 +571,12 @@ func (m *Security) GetUserSecurityProfiles() []UserSecurityProfileable { // Serialize serializes information the current object func (m *Security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("agenticSecurity", m.GetAgenticSecurity()) + if err != nil { + return err + } + } if m.GetAlerts() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAlerts())) for i, v := range m.GetAlerts() { @@ -555,6 +607,12 @@ func (m *Security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c01 return err } } + { + err := writer.WriteObjectValue("contentManagement", m.GetContentManagement()) + if err != nil { + return err + } + } { err := writer.WriteObjectValue("dataSecurityAndGovernance", m.GetDataSecurityAndGovernance()) if err != nil { @@ -722,6 +780,14 @@ func (m *Security) SetAdditionalData(value map[string]any) { } } +// SetAgenticSecurity sets the agenticSecurity property value. The agenticSecurity property +func (m *Security) SetAgenticSecurity(value AgenticSecurityRootable) { + err := m.GetBackingStore().Set("agenticSecurity", value) + if err != nil { + panic(err) + } +} + // SetAlerts sets the alerts property value. Notifications for suspicious or potential security issues in a customer's tenant. func (m *Security) SetAlerts(value []Alertable) { err := m.GetBackingStore().Set("alerts", value) @@ -751,6 +817,14 @@ func (m *Security) SetCloudAppSecurityProfiles(value []CloudAppSecurityProfileab } } +// SetContentManagement sets the contentManagement property value. The contentManagement property +func (m *Security) SetContentManagement(value ContentManagementRootable) { + err := m.GetBackingStore().Set("contentManagement", value) + if err != nil { + panic(err) + } +} + // SetDataSecurityAndGovernance sets the dataSecurityAndGovernance property value. The dataSecurityAndGovernance property func (m *Security) SetDataSecurityAndGovernance(value TenantDataSecurityAndGovernanceable) { err := m.GetBackingStore().Set("dataSecurityAndGovernance", value) @@ -867,10 +941,12 @@ type Securityable interface { i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAgenticSecurity() AgenticSecurityRootable GetAlerts() []Alertable GetAttackSimulation() AttackSimulationRootable GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore GetCloudAppSecurityProfiles() []CloudAppSecurityProfileable + GetContentManagement() ContentManagementRootable GetDataSecurityAndGovernance() TenantDataSecurityAndGovernanceable GetDomainSecurityProfiles() []DomainSecurityProfileable GetFileSecurityProfiles() []FileSecurityProfileable @@ -885,10 +961,12 @@ type Securityable interface { GetSubjectRightsRequests() []SubjectRightsRequestable GetTiIndicators() []TiIndicatorable GetUserSecurityProfiles() []UserSecurityProfileable + SetAgenticSecurity(value AgenticSecurityRootable) SetAlerts(value []Alertable) SetAttackSimulation(value AttackSimulationRootable) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) SetCloudAppSecurityProfiles(value []CloudAppSecurityProfileable) + SetContentManagement(value ContentManagementRootable) SetDataSecurityAndGovernance(value TenantDataSecurityAndGovernanceable) SetDomainSecurityProfiles(value []DomainSecurityProfileable) SetFileSecurityProfiles(value []FileSecurityProfileable) diff --git a/models/security/casemanagement/case_type_configuration.go b/models/security/casemanagement/case_type_configuration.go index 4737856d7e2..325e7b5d84b 100644 --- a/models/security/casemanagement/case_type_configuration.go +++ b/models/security/casemanagement/case_type_configuration.go @@ -26,7 +26,7 @@ func CreateCaseTypeConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89 return NewCaseTypeConfiguration(), nil } -// GetCustomFields gets the customFields property value. The contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// GetCustomFields gets the customFields property value. The contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a []CustomFieldDefinitionable when successful func (m *CaseTypeConfiguration) GetCustomFields() []CustomFieldDefinitionable { val, err := m.GetBackingStore().Get("customFields") @@ -140,7 +140,7 @@ func (m *CaseTypeConfiguration) GetFieldDeserializers() map[string]func(i878a80d return res } -// GetSlaPolicies gets the slaPolicies property value. The contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// GetSlaPolicies gets the slaPolicies property value. The contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. // returns a []SlaPolicyDefinitionable when successful func (m *CaseTypeConfiguration) GetSlaPolicies() []SlaPolicyDefinitionable { val, err := m.GetBackingStore().Get("slaPolicies") @@ -153,7 +153,7 @@ func (m *CaseTypeConfiguration) GetSlaPolicies() []SlaPolicyDefinitionable { return nil } -// GetStatuses gets the statuses property value. The contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// GetStatuses gets the statuses property value. The contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a []StatusDefinitionable when successful func (m *CaseTypeConfiguration) GetStatuses() []StatusDefinitionable { val, err := m.GetBackingStore().Get("statuses") @@ -223,7 +223,7 @@ func (m *CaseTypeConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487e return nil } -// SetCustomFields sets the customFields property value. The contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// SetCustomFields sets the customFields property value. The contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. func (m *CaseTypeConfiguration) SetCustomFields(value []CustomFieldDefinitionable) { err := m.GetBackingStore().Set("customFields", value) if err != nil { @@ -247,7 +247,7 @@ func (m *CaseTypeConfiguration) SetDisplayName(value *string) { } } -// SetSlaPolicies sets the slaPolicies property value. The contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// SetSlaPolicies sets the slaPolicies property value. The contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. func (m *CaseTypeConfiguration) SetSlaPolicies(value []SlaPolicyDefinitionable) { err := m.GetBackingStore().Set("slaPolicies", value) if err != nil { @@ -255,7 +255,7 @@ func (m *CaseTypeConfiguration) SetSlaPolicies(value []SlaPolicyDefinitionable) } } -// SetStatuses sets the statuses property value. The contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// SetStatuses sets the statuses property value. The contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. func (m *CaseTypeConfiguration) SetStatuses(value []StatusDefinitionable) { err := m.GetBackingStore().Set("statuses", value) if err != nil { diff --git a/models/security/contentmanagement/content_management_repository.go b/models/security/contentmanagement/content_management_repository.go new file mode 100644 index 00000000000..f78eb5fa96b --- /dev/null +++ b/models/security/contentmanagement/content_management_repository.go @@ -0,0 +1,494 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +// ContentManagementRepository a connected source-control repository that delivers security content as code(the customer-facing shape of the internal Source Control resource). Tenant is resolvedfrom the caller token; there is no subscription, resource group, or workspace in the path. +type ContentManagementRepository struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Entity +} + +// NewContentManagementRepository instantiates a new ContentManagementRepository and sets the default values. +func NewContentManagementRepository() *ContentManagementRepository { + m := &ContentManagementRepository{ + Entity: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewEntity(), + } + return m +} + +// CreateContentManagementRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepository(), nil +} + +// GetContentTypes gets the contentTypes property value. Content kinds this repository is configured to deploy. The possible values are: customDetection, unknownFutureValue, defenderWorkbook. Use the Prefer: include-unknown-enum-members request header to get defenderWorkbook. +// returns a []RepositoryContentType when successful +func (m *ContentManagementRepository) GetContentTypes() []RepositoryContentType { + val, err := m.GetBackingStore().Get("contentTypes") + if err != nil { + panic(err) + } + if val != nil { + return val.([]RepositoryContentType) + } + return nil +} + +// GetDeploymentIdentity gets the deploymentIdentity property value. Bring-your-own deployment identity used for deployment. Optional; when omitted the platform-managed identity path is used. Provide a service principal or a managed identity. Immutable after connecting. +// returns a DeploymentIdentityable when successful +func (m *ContentManagementRepository) GetDeploymentIdentity() DeploymentIdentityable { + val, err := m.GetBackingStore().Get("deploymentIdentity") + if err != nil { + panic(err) + } + if val != nil { + return val.(DeploymentIdentityable) + } + return nil +} + +// GetDeploymentScope gets the deploymentScope property value. Optional Azure deployment scope, immutable after connecting the repository. +// returns a DeploymentScopeable when successful +func (m *ContentManagementRepository) GetDeploymentScope() DeploymentScopeable { + val, err := m.GetBackingStore().Get("deploymentScope") + if err != nil { + panic(err) + } + if val != nil { + return val.(DeploymentScopeable) + } + return nil +} + +// GetDescription gets the description property value. Optional description of the connection. +// returns a *string when successful +func (m *ContentManagementRepository) GetDescription() *string { + val, err := m.GetBackingStore().Get("description") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayName gets the displayName property value. Human-readable name of the connection. Supports $filter (eq, ne) and $orderby. +// returns a *string when successful +func (m *ContentManagementRepository) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepository) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.Entity.GetFieldDeserializers() + res["contentTypes"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseRepositoryContentType) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryContentType, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*RepositoryContentType)) + } + } + m.SetContentTypes(res) + } + return nil + } + res["deploymentIdentity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDeploymentIdentityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentIdentity(val.(DeploymentIdentityable)) + } + return nil + } + res["deploymentScope"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDeploymentScopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentScope(val.(DeploymentScopeable)) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["lastDeploymentInfo"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryDeploymentInfoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLastDeploymentInfo(val.(RepositoryDeploymentInfoable)) + } + return nil + } + res["pullRequest"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryPullRequestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(RepositoryPullRequestable)) + } + return nil + } + res["repoType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryType) + if err != nil { + return err + } + if val != nil { + m.SetRepoType(val.(*RepositoryType)) + } + return nil + } + res["servicePrincipal"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryServicePrincipalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetServicePrincipal(val.(RepositoryServicePrincipalable)) + } + return nil + } + res["sourceLocation"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositorySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSourceLocation(val.(RepositorySettingsable)) + } + return nil + } + res["systemData"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSystemDataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSystemData(val.(SystemDataable)) + } + return nil + } + res["workloadIdentityFederation"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryWorkloadIdentityFederationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetWorkloadIdentityFederation(val.(RepositoryWorkloadIdentityFederationable)) + } + return nil + } + return res +} + +// GetLastDeploymentInfo gets the lastDeploymentInfo property value. Status of the most recent deployment from this repository. Read-only. +// returns a RepositoryDeploymentInfoable when successful +func (m *ContentManagementRepository) GetLastDeploymentInfo() RepositoryDeploymentInfoable { + val, err := m.GetBackingStore().Get("lastDeploymentInfo") + if err != nil { + panic(err) + } + if val != nil { + return val.(RepositoryDeploymentInfoable) + } + return nil +} + +// GetPullRequest gets the pullRequest property value. The setup pull request opened for this connection, when applicable. Read-only. +// returns a RepositoryPullRequestable when successful +func (m *ContentManagementRepository) GetPullRequest() RepositoryPullRequestable { + val, err := m.GetBackingStore().Get("pullRequest") + if err != nil { + panic(err) + } + if val != nil { + return val.(RepositoryPullRequestable) + } + return nil +} + +// GetRepoType gets the repoType property value. Source-control provider. +// returns a *RepositoryType when successful +func (m *ContentManagementRepository) GetRepoType() *RepositoryType { + val, err := m.GetBackingStore().Get("repoType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*RepositoryType) + } + return nil +} + +// GetServicePrincipal gets the servicePrincipal property value. Service principal / managed identity used by the connection. Read-only. +// returns a RepositoryServicePrincipalable when successful +func (m *ContentManagementRepository) GetServicePrincipal() RepositoryServicePrincipalable { + val, err := m.GetBackingStore().Get("servicePrincipal") + if err != nil { + panic(err) + } + if val != nil { + return val.(RepositoryServicePrincipalable) + } + return nil +} + +// GetSourceLocation gets the sourceLocation property value. Repository location settings. +// returns a RepositorySettingsable when successful +func (m *ContentManagementRepository) GetSourceLocation() RepositorySettingsable { + val, err := m.GetBackingStore().Get("sourceLocation") + if err != nil { + panic(err) + } + if val != nil { + return val.(RepositorySettingsable) + } + return nil +} + +// GetSystemData gets the systemData property value. Creation and last modification provenance. Read-only. +// returns a SystemDataable when successful +func (m *ContentManagementRepository) GetSystemData() SystemDataable { + val, err := m.GetBackingStore().Get("systemData") + if err != nil { + panic(err) + } + if val != nil { + return val.(SystemDataable) + } + return nil +} + +// GetWorkloadIdentityFederation gets the workloadIdentityFederation property value. Workload identity federation details for the connection, when configured. Read-only. +// returns a RepositoryWorkloadIdentityFederationable when successful +func (m *ContentManagementRepository) GetWorkloadIdentityFederation() RepositoryWorkloadIdentityFederationable { + val, err := m.GetBackingStore().Get("workloadIdentityFederation") + if err != nil { + panic(err) + } + if val != nil { + return val.(RepositoryWorkloadIdentityFederationable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ContentManagementRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.Entity.Serialize(writer) + if err != nil { + return err + } + if m.GetContentTypes() != nil { + err = writer.WriteCollectionOfStringValues("contentTypes", SerializeRepositoryContentType(m.GetContentTypes())) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("deploymentIdentity", m.GetDeploymentIdentity()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("deploymentScope", m.GetDeploymentScope()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + if m.GetRepoType() != nil { + cast := (*m.GetRepoType()).String() + err = writer.WriteStringValue("repoType", &cast) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("sourceLocation", m.GetSourceLocation()) + if err != nil { + return err + } + } + return nil +} + +// SetContentTypes sets the contentTypes property value. Content kinds this repository is configured to deploy. The possible values are: customDetection, unknownFutureValue, defenderWorkbook. Use the Prefer: include-unknown-enum-members request header to get defenderWorkbook. +func (m *ContentManagementRepository) SetContentTypes(value []RepositoryContentType) { + err := m.GetBackingStore().Set("contentTypes", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentIdentity sets the deploymentIdentity property value. Bring-your-own deployment identity used for deployment. Optional; when omitted the platform-managed identity path is used. Provide a service principal or a managed identity. Immutable after connecting. +func (m *ContentManagementRepository) SetDeploymentIdentity(value DeploymentIdentityable) { + err := m.GetBackingStore().Set("deploymentIdentity", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentScope sets the deploymentScope property value. Optional Azure deployment scope, immutable after connecting the repository. +func (m *ContentManagementRepository) SetDeploymentScope(value DeploymentScopeable) { + err := m.GetBackingStore().Set("deploymentScope", value) + if err != nil { + panic(err) + } +} + +// SetDescription sets the description property value. Optional description of the connection. +func (m *ContentManagementRepository) SetDescription(value *string) { + err := m.GetBackingStore().Set("description", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. Human-readable name of the connection. Supports $filter (eq, ne) and $orderby. +func (m *ContentManagementRepository) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetLastDeploymentInfo sets the lastDeploymentInfo property value. Status of the most recent deployment from this repository. Read-only. +func (m *ContentManagementRepository) SetLastDeploymentInfo(value RepositoryDeploymentInfoable) { + err := m.GetBackingStore().Set("lastDeploymentInfo", value) + if err != nil { + panic(err) + } +} + +// SetPullRequest sets the pullRequest property value. The setup pull request opened for this connection, when applicable. Read-only. +func (m *ContentManagementRepository) SetPullRequest(value RepositoryPullRequestable) { + err := m.GetBackingStore().Set("pullRequest", value) + if err != nil { + panic(err) + } +} + +// SetRepoType sets the repoType property value. Source-control provider. +func (m *ContentManagementRepository) SetRepoType(value *RepositoryType) { + err := m.GetBackingStore().Set("repoType", value) + if err != nil { + panic(err) + } +} + +// SetServicePrincipal sets the servicePrincipal property value. Service principal / managed identity used by the connection. Read-only. +func (m *ContentManagementRepository) SetServicePrincipal(value RepositoryServicePrincipalable) { + err := m.GetBackingStore().Set("servicePrincipal", value) + if err != nil { + panic(err) + } +} + +// SetSourceLocation sets the sourceLocation property value. Repository location settings. +func (m *ContentManagementRepository) SetSourceLocation(value RepositorySettingsable) { + err := m.GetBackingStore().Set("sourceLocation", value) + if err != nil { + panic(err) + } +} + +// SetSystemData sets the systemData property value. Creation and last modification provenance. Read-only. +func (m *ContentManagementRepository) SetSystemData(value SystemDataable) { + err := m.GetBackingStore().Set("systemData", value) + if err != nil { + panic(err) + } +} + +// SetWorkloadIdentityFederation sets the workloadIdentityFederation property value. Workload identity federation details for the connection, when configured. Read-only. +func (m *ContentManagementRepository) SetWorkloadIdentityFederation(value RepositoryWorkloadIdentityFederationable) { + err := m.GetBackingStore().Set("workloadIdentityFederation", value) + if err != nil { + panic(err) + } +} + +type ContentManagementRepositoryable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Entityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentTypes() []RepositoryContentType + GetDeploymentIdentity() DeploymentIdentityable + GetDeploymentScope() DeploymentScopeable + GetDescription() *string + GetDisplayName() *string + GetLastDeploymentInfo() RepositoryDeploymentInfoable + GetPullRequest() RepositoryPullRequestable + GetRepoType() *RepositoryType + GetServicePrincipal() RepositoryServicePrincipalable + GetSourceLocation() RepositorySettingsable + GetSystemData() SystemDataable + GetWorkloadIdentityFederation() RepositoryWorkloadIdentityFederationable + SetContentTypes(value []RepositoryContentType) + SetDeploymentIdentity(value DeploymentIdentityable) + SetDeploymentScope(value DeploymentScopeable) + SetDescription(value *string) + SetDisplayName(value *string) + SetLastDeploymentInfo(value RepositoryDeploymentInfoable) + SetPullRequest(value RepositoryPullRequestable) + SetRepoType(value *RepositoryType) + SetServicePrincipal(value RepositoryServicePrincipalable) + SetSourceLocation(value RepositorySettingsable) + SetSystemData(value SystemDataable) + SetWorkloadIdentityFederation(value RepositoryWorkloadIdentityFederationable) +} diff --git a/models/security/contentmanagement/content_management_repository_collection_response.go b/models/security/contentmanagement/content_management_repository_collection_response.go new file mode 100644 index 00000000000..a133bb73f7f --- /dev/null +++ b/models/security/contentmanagement/content_management_repository_collection_response.go @@ -0,0 +1,99 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ContentManagementRepositoryCollectionResponse struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse +} + +// NewContentManagementRepositoryCollectionResponse instantiates a new ContentManagementRepositoryCollectionResponse and sets the default values. +func NewContentManagementRepositoryCollectionResponse() *ContentManagementRepositoryCollectionResponse { + m := &ContentManagementRepositoryCollectionResponse{ + BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateContentManagementRepositoryCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoryCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoryCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepositoryCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateContentManagementRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ContentManagementRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ContentManagementRepositoryable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ContentManagementRepositoryable when successful +func (m *ContentManagementRepositoryCollectionResponse) GetValue() []ContentManagementRepositoryable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ContentManagementRepositoryable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ContentManagementRepositoryCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ContentManagementRepositoryCollectionResponse) SetValue(value []ContentManagementRepositoryable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ContentManagementRepositoryCollectionResponseable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ContentManagementRepositoryable + SetValue(value []ContentManagementRepositoryable) +} diff --git a/models/security/contentmanagement/deployment_identity.go b/models/security/contentmanagement/deployment_identity.go new file mode 100644 index 00000000000..57359139873 --- /dev/null +++ b/models/security/contentmanagement/deployment_identity.go @@ -0,0 +1,147 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// DeploymentIdentity bring-your-own deployment identity. The concrete type (set via `@odata.type`) selectswhether a service principal or a managed identity backs the connection. +type DeploymentIdentity struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewDeploymentIdentity instantiates a new DeploymentIdentity and sets the default values. +func NewDeploymentIdentity() *DeploymentIdentity { + m := &DeploymentIdentity{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateDeploymentIdentityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentIdentityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("@odata.type") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + switch *mappingValue { + case "#microsoft.graph.security.contentManagement.managedIdentityDeploymentIdentity": + return NewManagedIdentityDeploymentIdentity(), nil + case "#microsoft.graph.security.contentManagement.servicePrincipalDeploymentIdentity": + return NewServicePrincipalDeploymentIdentity(), nil + } + } + } + } + return NewDeploymentIdentity(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *DeploymentIdentity) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *DeploymentIdentity) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *DeploymentIdentity) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *DeploymentIdentity) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *DeploymentIdentity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DeploymentIdentity) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *DeploymentIdentity) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *DeploymentIdentity) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type DeploymentIdentityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/security/contentmanagement/deployment_scope.go b/models/security/contentmanagement/deployment_scope.go new file mode 100644 index 00000000000..72ec68d93b4 --- /dev/null +++ b/models/security/contentmanagement/deployment_scope.go @@ -0,0 +1,206 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// DeploymentScope optional Azure scope where the deployment stack is provisioned. +type DeploymentScope struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewDeploymentScope instantiates a new DeploymentScope and sets the default values. +func NewDeploymentScope() *DeploymentScope { + m := &DeploymentScope{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateDeploymentScopeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentScopeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentScope(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *DeploymentScope) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *DeploymentScope) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *DeploymentScope) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["id"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["scopeType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentScopeType) + if err != nil { + return err + } + if val != nil { + m.SetScopeType(val.(*DeploymentScopeType)) + } + return nil + } + return res +} + +// GetId gets the id property value. ARM resource id of the scope: a resource group (/subscriptions/{id}/resourceGroups/{name}) or a management group (/providers/Microsoft.Management/managementGroups/{id}). +// returns a *string when successful +func (m *DeploymentScope) GetId() *string { + val, err := m.GetBackingStore().Get("id") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *DeploymentScope) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetScopeType gets the scopeType property value. Azure scope kind for deployment stack provisioning. +// returns a *DeploymentScopeType when successful +func (m *DeploymentScope) GetScopeType() *DeploymentScopeType { + val, err := m.GetBackingStore().Get("scopeType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*DeploymentScopeType) + } + return nil +} + +// Serialize serializes information the current object +func (m *DeploymentScope) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetScopeType() != nil { + cast := (*m.GetScopeType()).String() + err := writer.WriteStringValue("scopeType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DeploymentScope) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *DeploymentScope) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetId sets the id property value. ARM resource id of the scope: a resource group (/subscriptions/{id}/resourceGroups/{name}) or a management group (/providers/Microsoft.Management/managementGroups/{id}). +func (m *DeploymentScope) SetId(value *string) { + err := m.GetBackingStore().Set("id", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *DeploymentScope) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetScopeType sets the scopeType property value. Azure scope kind for deployment stack provisioning. +func (m *DeploymentScope) SetScopeType(value *DeploymentScopeType) { + err := m.GetBackingStore().Set("scopeType", value) + if err != nil { + panic(err) + } +} + +type DeploymentScopeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetId() *string + GetOdataType() *string + GetScopeType() *DeploymentScopeType + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetId(value *string) + SetOdataType(value *string) + SetScopeType(value *DeploymentScopeType) +} diff --git a/models/security/contentmanagement/deployment_scope_type.go b/models/security/contentmanagement/deployment_scope_type.go new file mode 100644 index 00000000000..353494cc62e --- /dev/null +++ b/models/security/contentmanagement/deployment_scope_type.go @@ -0,0 +1,47 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// Azure scope kind for deployment stack provisioning. +type DeploymentScopeType int + +const ( + // Azure resource group. + RESOURCEGROUP_DEPLOYMENTSCOPETYPE DeploymentScopeType = iota + // Azure management group. + MANAGEMENTGROUP_DEPLOYMENTSCOPETYPE + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_DEPLOYMENTSCOPETYPE +) + +func (i DeploymentScopeType) String() string { + return []string{"resourceGroup", "managementGroup", "unknownFutureValue"}[i] +} + +func ParseDeploymentScopeType(v string) (any, error) { + result := RESOURCEGROUP_DEPLOYMENTSCOPETYPE + switch v { + case "resourceGroup": + result = RESOURCEGROUP_DEPLOYMENTSCOPETYPE + case "managementGroup": + result = MANAGEMENTGROUP_DEPLOYMENTSCOPETYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_DEPLOYMENTSCOPETYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeDeploymentScopeType(values []DeploymentScopeType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i DeploymentScopeType) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/discovered_repository.go b/models/security/contentmanagement/discovered_repository.go new file mode 100644 index 00000000000..6e6df384b82 --- /dev/null +++ b/models/security/contentmanagement/discovered_repository.go @@ -0,0 +1,250 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// DiscoveredRepository a candidate repository returned by the discoverAvailableRepositories discovery action. +type DiscoveredRepository struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewDiscoveredRepository instantiates a new DiscoveredRepository and sets the default values. +func NewDiscoveredRepository() *DiscoveredRepository { + m := &DiscoveredRepository{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateDiscoveredRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDiscoveredRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDiscoveredRepository(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *DiscoveredRepository) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *DiscoveredRepository) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetBranches gets the branches property value. Branch names available in the repository. +// returns a []string when successful +func (m *DiscoveredRepository) GetBranches() []string { + val, err := m.GetBackingStore().Get("branches") + if err != nil { + panic(err) + } + if val != nil { + return val.([]string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *DiscoveredRepository) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["branches"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + if err != nil { + return err + } + if val != nil { + res := make([]string, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*string)) + } + } + m.SetBranches(res) + } + return nil + } + res["fullName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["url"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} + +// GetFullName gets the fullName property value. Provider full name, for example owner/repo. +// returns a *string when successful +func (m *DiscoveredRepository) GetFullName() *string { + val, err := m.GetBackingStore().Get("fullName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *DiscoveredRepository) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUrl gets the url property value. Repository URL. +// returns a *string when successful +func (m *DiscoveredRepository) GetUrl() *string { + val, err := m.GetBackingStore().Get("url") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *DiscoveredRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetBranches() != nil { + err := writer.WriteCollectionOfStringValues("branches", m.GetBranches()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fullName", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *DiscoveredRepository) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *DiscoveredRepository) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetBranches sets the branches property value. Branch names available in the repository. +func (m *DiscoveredRepository) SetBranches(value []string) { + err := m.GetBackingStore().Set("branches", value) + if err != nil { + panic(err) + } +} + +// SetFullName sets the fullName property value. Provider full name, for example owner/repo. +func (m *DiscoveredRepository) SetFullName(value *string) { + err := m.GetBackingStore().Set("fullName", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *DiscoveredRepository) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetUrl sets the url property value. Repository URL. +func (m *DiscoveredRepository) SetUrl(value *string) { + err := m.GetBackingStore().Set("url", value) + if err != nil { + panic(err) + } +} + +type DiscoveredRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetBranches() []string + GetFullName() *string + GetOdataType() *string + GetUrl() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetBranches(value []string) + SetFullName(value *string) + SetOdataType(value *string) + SetUrl(value *string) +} diff --git a/models/security/contentmanagement/managed_identity_deployment_identity.go b/models/security/contentmanagement/managed_identity_deployment_identity.go new file mode 100644 index 00000000000..a69a2862bf1 --- /dev/null +++ b/models/security/contentmanagement/managed_identity_deployment_identity.go @@ -0,0 +1,89 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ManagedIdentityDeploymentIdentity bring-your-own user-assigned managed identity. +type ManagedIdentityDeploymentIdentity struct { + DeploymentIdentity +} + +// NewManagedIdentityDeploymentIdentity instantiates a new ManagedIdentityDeploymentIdentity and sets the default values. +func NewManagedIdentityDeploymentIdentity() *ManagedIdentityDeploymentIdentity { + m := &ManagedIdentityDeploymentIdentity{ + DeploymentIdentity: *NewDeploymentIdentity(), + } + odataTypeValue := "#microsoft.graph.security.contentManagement.managedIdentityDeploymentIdentity" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreateManagedIdentityDeploymentIdentityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateManagedIdentityDeploymentIdentityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewManagedIdentityDeploymentIdentity(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ManagedIdentityDeploymentIdentity) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.DeploymentIdentity.GetFieldDeserializers() + res["managedIdentityId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManagedIdentityId(val) + } + return nil + } + return res +} + +// GetManagedIdentityId gets the managedIdentityId property value. Resource id of the user-assigned managed identity. +// returns a *string when successful +func (m *ManagedIdentityDeploymentIdentity) GetManagedIdentityId() *string { + val, err := m.GetBackingStore().Get("managedIdentityId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ManagedIdentityDeploymentIdentity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.DeploymentIdentity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("managedIdentityId", m.GetManagedIdentityId()) + if err != nil { + return err + } + } + return nil +} + +// SetManagedIdentityId sets the managedIdentityId property value. Resource id of the user-assigned managed identity. +func (m *ManagedIdentityDeploymentIdentity) SetManagedIdentityId(value *string) { + err := m.GetBackingStore().Set("managedIdentityId", value) + if err != nil { + panic(err) + } +} + +type ManagedIdentityDeploymentIdentityable interface { + DeploymentIdentityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetManagedIdentityId() *string + SetManagedIdentityId(value *string) +} diff --git a/models/security/contentmanagement/repository_access_credential.go b/models/security/contentmanagement/repository_access_credential.go new file mode 100644 index 00000000000..cd93481cb58 --- /dev/null +++ b/models/security/contentmanagement/repository_access_credential.go @@ -0,0 +1,147 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// RepositoryAccessCredential provider credential used to establish or refresh repository access. The concrete type(set via `@odata.type`) selects the credential style. All fields are input only and arenever returned. +type RepositoryAccessCredential struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryAccessCredential instantiates a new RepositoryAccessCredential and sets the default values. +func NewRepositoryAccessCredential() *RepositoryAccessCredential { + m := &RepositoryAccessCredential{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryAccessCredentialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryAccessCredentialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("@odata.type") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + switch *mappingValue { + case "#microsoft.graph.security.contentManagement.repositoryOAuthCredential": + return NewRepositoryOAuthCredential(), nil + case "#microsoft.graph.security.contentManagement.repositoryPatCredential": + return NewRepositoryPatCredential(), nil + } + } + } + } + return NewRepositoryAccessCredential(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryAccessCredential) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryAccessCredential) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryAccessCredential) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryAccessCredential) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryAccessCredential) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryAccessCredential) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryAccessCredential) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryAccessCredential) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type RepositoryAccessCredentialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) +} diff --git a/models/security/contentmanagement/repository_content_type.go b/models/security/contentmanagement/repository_content_type.go new file mode 100644 index 00000000000..07269967f7d --- /dev/null +++ b/models/security/contentmanagement/repository_content_type.go @@ -0,0 +1,47 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// Content kind a repository can deploy. The tenant/E5 path deploys custom detections andDefender Workbooks; additional content kinds are added as the tenant path gains support. +type RepositoryContentType int + +const ( + // Custom detection. + CUSTOMDETECTION_REPOSITORYCONTENTTYPE RepositoryContentType = iota + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_REPOSITORYCONTENTTYPE + // Defender workbook. + DEFENDERWORKBOOK_REPOSITORYCONTENTTYPE +) + +func (i RepositoryContentType) String() string { + return []string{"customDetection", "unknownFutureValue", "defenderWorkbook"}[i] +} + +func ParseRepositoryContentType(v string) (any, error) { + result := CUSTOMDETECTION_REPOSITORYCONTENTTYPE + switch v { + case "customDetection": + result = CUSTOMDETECTION_REPOSITORYCONTENTTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REPOSITORYCONTENTTYPE + case "defenderWorkbook": + result = DEFENDERWORKBOOK_REPOSITORYCONTENTTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeRepositoryContentType(values []RepositoryContentType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RepositoryContentType) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/repository_deployment.go b/models/security/contentmanagement/repository_deployment.go new file mode 100644 index 00000000000..fbd470d53a0 --- /dev/null +++ b/models/security/contentmanagement/repository_deployment.go @@ -0,0 +1,307 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// RepositoryDeployment details of a fetched deployment run. Read-only. +type RepositoryDeployment struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryDeployment instantiates a new RepositoryDeployment and sets the default values. +func NewRepositoryDeployment() *RepositoryDeployment { + m := &RepositoryDeployment{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryDeployment(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryDeployment) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryDeployment) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDeploymentDateTime gets the deploymentDateTime property value. When the deployment ran. +// returns a *Time when successful +func (m *RepositoryDeployment) GetDeploymentDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("deploymentDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetDeploymentId gets the deploymentId property value. Deployment id. +// returns a *string when successful +func (m *RepositoryDeployment) GetDeploymentId() *string { + val, err := m.GetBackingStore().Get("deploymentId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDeploymentLogsUrl gets the deploymentLogsUrl property value. URL where the deployment logs can be viewed. +// returns a *string when successful +func (m *RepositoryDeployment) GetDeploymentLogsUrl() *string { + val, err := m.GetBackingStore().Get("deploymentLogsUrl") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDeploymentResult gets the deploymentResult property value. Result of a completed deployment. +// returns a *RepositoryDeploymentResult when successful +func (m *RepositoryDeployment) GetDeploymentResult() *RepositoryDeploymentResult { + val, err := m.GetBackingStore().Get("deploymentResult") + if err != nil { + panic(err) + } + if val != nil { + return val.(*RepositoryDeploymentResult) + } + return nil +} + +// GetDeploymentState gets the deploymentState property value. State of a deployment run. +// returns a *RepositoryDeploymentState when successful +func (m *RepositoryDeployment) GetDeploymentState() *RepositoryDeploymentState { + val, err := m.GetBackingStore().Get("deploymentState") + if err != nil { + panic(err) + } + if val != nil { + return val.(*RepositoryDeploymentState) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryDeployment) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["deploymentDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentDateTime(val) + } + return nil + } + res["deploymentId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentId(val) + } + return nil + } + res["deploymentLogsUrl"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentLogsUrl(val) + } + return nil + } + res["deploymentResult"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryDeploymentResult) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentResult(val.(*RepositoryDeploymentResult)) + } + return nil + } + res["deploymentState"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryDeploymentState) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentState(val.(*RepositoryDeploymentState)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryDeployment) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryDeployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetDeploymentResult() != nil { + cast := (*m.GetDeploymentResult()).String() + err := writer.WriteStringValue("deploymentResult", &cast) + if err != nil { + return err + } + } + if m.GetDeploymentState() != nil { + cast := (*m.GetDeploymentState()).String() + err := writer.WriteStringValue("deploymentState", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryDeployment) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryDeployment) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDeploymentDateTime sets the deploymentDateTime property value. When the deployment ran. +func (m *RepositoryDeployment) SetDeploymentDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("deploymentDateTime", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentId sets the deploymentId property value. Deployment id. +func (m *RepositoryDeployment) SetDeploymentId(value *string) { + err := m.GetBackingStore().Set("deploymentId", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentLogsUrl sets the deploymentLogsUrl property value. URL where the deployment logs can be viewed. +func (m *RepositoryDeployment) SetDeploymentLogsUrl(value *string) { + err := m.GetBackingStore().Set("deploymentLogsUrl", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentResult sets the deploymentResult property value. Result of a completed deployment. +func (m *RepositoryDeployment) SetDeploymentResult(value *RepositoryDeploymentResult) { + err := m.GetBackingStore().Set("deploymentResult", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentState sets the deploymentState property value. State of a deployment run. +func (m *RepositoryDeployment) SetDeploymentState(value *RepositoryDeploymentState) { + err := m.GetBackingStore().Set("deploymentState", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryDeployment) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type RepositoryDeploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDeploymentDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetDeploymentId() *string + GetDeploymentLogsUrl() *string + GetDeploymentResult() *RepositoryDeploymentResult + GetDeploymentState() *RepositoryDeploymentState + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDeploymentDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetDeploymentId(value *string) + SetDeploymentLogsUrl(value *string) + SetDeploymentResult(value *RepositoryDeploymentResult) + SetDeploymentState(value *RepositoryDeploymentState) + SetOdataType(value *string) +} diff --git a/models/security/contentmanagement/repository_deployment_fetch_status.go b/models/security/contentmanagement/repository_deployment_fetch_status.go new file mode 100644 index 00000000000..f4145e9099c --- /dev/null +++ b/models/security/contentmanagement/repository_deployment_fetch_status.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// Whether deployment status could be fetched. +type RepositoryDeploymentFetchStatus int + +const ( + // Status fetched successfully. + SUCCESS_REPOSITORYDEPLOYMENTFETCHSTATUS RepositoryDeploymentFetchStatus = iota + // Caller was not authorized to fetch status. + UNAUTHORIZED_REPOSITORYDEPLOYMENTFETCHSTATUS + // No deployment was found. + NOTFOUND_REPOSITORYDEPLOYMENTFETCHSTATUS + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_REPOSITORYDEPLOYMENTFETCHSTATUS + // Provider status could not be fetched. + UNAVAILABLE_REPOSITORYDEPLOYMENTFETCHSTATUS +) + +func (i RepositoryDeploymentFetchStatus) String() string { + return []string{"success", "unauthorized", "notFound", "unknownFutureValue", "unavailable"}[i] +} + +func ParseRepositoryDeploymentFetchStatus(v string) (any, error) { + result := SUCCESS_REPOSITORYDEPLOYMENTFETCHSTATUS + switch v { + case "success": + result = SUCCESS_REPOSITORYDEPLOYMENTFETCHSTATUS + case "unauthorized": + result = UNAUTHORIZED_REPOSITORYDEPLOYMENTFETCHSTATUS + case "notFound": + result = NOTFOUND_REPOSITORYDEPLOYMENTFETCHSTATUS + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REPOSITORYDEPLOYMENTFETCHSTATUS + case "unavailable": + result = UNAVAILABLE_REPOSITORYDEPLOYMENTFETCHSTATUS + default: + return nil, nil + } + return &result, nil +} + +func SerializeRepositoryDeploymentFetchStatus(values []RepositoryDeploymentFetchStatus) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RepositoryDeploymentFetchStatus) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/repository_deployment_info.go b/models/security/contentmanagement/repository_deployment_info.go new file mode 100644 index 00000000000..9739dca2d90 --- /dev/null +++ b/models/security/contentmanagement/repository_deployment_info.go @@ -0,0 +1,233 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// RepositoryDeploymentInfo status fetch result and the most recent deployment, when available. +type RepositoryDeploymentInfo struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryDeploymentInfo instantiates a new RepositoryDeploymentInfo and sets the default values. +func NewRepositoryDeploymentInfo() *RepositoryDeploymentInfo { + m := &RepositoryDeploymentInfo{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryDeploymentInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryDeploymentInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryDeploymentInfo(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryDeploymentInfo) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryDeploymentInfo) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDeploymentFetchStatus gets the deploymentFetchStatus property value. Whether deployment status could be fetched. +// returns a *RepositoryDeploymentFetchStatus when successful +func (m *RepositoryDeploymentInfo) GetDeploymentFetchStatus() *RepositoryDeploymentFetchStatus { + val, err := m.GetBackingStore().Get("deploymentFetchStatus") + if err != nil { + panic(err) + } + if val != nil { + return val.(*RepositoryDeploymentFetchStatus) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryDeploymentInfo) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["deploymentFetchStatus"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryDeploymentFetchStatus) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentFetchStatus(val.(*RepositoryDeploymentFetchStatus)) + } + return nil + } + res["message"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["run"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryDeploymentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRun(val.(RepositoryDeploymentable)) + } + return nil + } + return res +} + +// GetMessage gets the message property value. Human-readable status or error message. +// returns a *string when successful +func (m *RepositoryDeploymentInfo) GetMessage() *string { + val, err := m.GetBackingStore().Get("message") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryDeploymentInfo) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetRun gets the run property value. Deployment details; null when no run was fetched. +// returns a RepositoryDeploymentable when successful +func (m *RepositoryDeploymentInfo) GetRun() RepositoryDeploymentable { + val, err := m.GetBackingStore().Get("run") + if err != nil { + panic(err) + } + if val != nil { + return val.(RepositoryDeploymentable) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryDeploymentInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetDeploymentFetchStatus() != nil { + cast := (*m.GetDeploymentFetchStatus()).String() + err := writer.WriteStringValue("deploymentFetchStatus", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryDeploymentInfo) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryDeploymentInfo) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDeploymentFetchStatus sets the deploymentFetchStatus property value. Whether deployment status could be fetched. +func (m *RepositoryDeploymentInfo) SetDeploymentFetchStatus(value *RepositoryDeploymentFetchStatus) { + err := m.GetBackingStore().Set("deploymentFetchStatus", value) + if err != nil { + panic(err) + } +} + +// SetMessage sets the message property value. Human-readable status or error message. +func (m *RepositoryDeploymentInfo) SetMessage(value *string) { + err := m.GetBackingStore().Set("message", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryDeploymentInfo) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetRun sets the run property value. Deployment details; null when no run was fetched. +func (m *RepositoryDeploymentInfo) SetRun(value RepositoryDeploymentable) { + err := m.GetBackingStore().Set("run", value) + if err != nil { + panic(err) + } +} + +type RepositoryDeploymentInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDeploymentFetchStatus() *RepositoryDeploymentFetchStatus + GetMessage() *string + GetOdataType() *string + GetRun() RepositoryDeploymentable + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDeploymentFetchStatus(value *RepositoryDeploymentFetchStatus) + SetMessage(value *string) + SetOdataType(value *string) + SetRun(value RepositoryDeploymentable) +} diff --git a/models/security/contentmanagement/repository_deployment_result.go b/models/security/contentmanagement/repository_deployment_result.go new file mode 100644 index 00000000000..3faf1931c8e --- /dev/null +++ b/models/security/contentmanagement/repository_deployment_result.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// Result of a completed deployment. +type RepositoryDeploymentResult int + +const ( + // Deployment succeeded. + SUCCESS_REPOSITORYDEPLOYMENTRESULT RepositoryDeploymentResult = iota + // Deployment was canceled. + CANCELED_REPOSITORYDEPLOYMENTRESULT + // Deployment failed. + FAILED_REPOSITORYDEPLOYMENTRESULT + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_REPOSITORYDEPLOYMENTRESULT + // The deployment has not produced a final result yet. + PENDING_REPOSITORYDEPLOYMENTRESULT +) + +func (i RepositoryDeploymentResult) String() string { + return []string{"success", "canceled", "failed", "unknownFutureValue", "pending"}[i] +} + +func ParseRepositoryDeploymentResult(v string) (any, error) { + result := SUCCESS_REPOSITORYDEPLOYMENTRESULT + switch v { + case "success": + result = SUCCESS_REPOSITORYDEPLOYMENTRESULT + case "canceled": + result = CANCELED_REPOSITORYDEPLOYMENTRESULT + case "failed": + result = FAILED_REPOSITORYDEPLOYMENTRESULT + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REPOSITORYDEPLOYMENTRESULT + case "pending": + result = PENDING_REPOSITORYDEPLOYMENTRESULT + default: + return nil, nil + } + return &result, nil +} + +func SerializeRepositoryDeploymentResult(values []RepositoryDeploymentResult) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RepositoryDeploymentResult) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/repository_deployment_state.go b/models/security/contentmanagement/repository_deployment_state.go new file mode 100644 index 00000000000..99e203a76b4 --- /dev/null +++ b/models/security/contentmanagement/repository_deployment_state.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// State of a deployment run. +type RepositoryDeploymentState int + +const ( + // Deployment is in progress. + INPROGRESS_REPOSITORYDEPLOYMENTSTATE RepositoryDeploymentState = iota + // Deployment completed. + COMPLETED_REPOSITORYDEPLOYMENTSTATE + // Deployment is queued. + QUEUED_REPOSITORYDEPLOYMENTSTATE + // Deployment is being canceled. + CANCELING_REPOSITORYDEPLOYMENTSTATE + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_REPOSITORYDEPLOYMENTSTATE +) + +func (i RepositoryDeploymentState) String() string { + return []string{"inProgress", "completed", "queued", "canceling", "unknownFutureValue"}[i] +} + +func ParseRepositoryDeploymentState(v string) (any, error) { + result := INPROGRESS_REPOSITORYDEPLOYMENTSTATE + switch v { + case "inProgress": + result = INPROGRESS_REPOSITORYDEPLOYMENTSTATE + case "completed": + result = COMPLETED_REPOSITORYDEPLOYMENTSTATE + case "queued": + result = QUEUED_REPOSITORYDEPLOYMENTSTATE + case "canceling": + result = CANCELING_REPOSITORYDEPLOYMENTSTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REPOSITORYDEPLOYMENTSTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeRepositoryDeploymentState(values []RepositoryDeploymentState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RepositoryDeploymentState) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/repository_disconnect_result.go b/models/security/contentmanagement/repository_disconnect_result.go new file mode 100644 index 00000000000..9eafaad2278 --- /dev/null +++ b/models/security/contentmanagement/repository_disconnect_result.go @@ -0,0 +1,160 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// RepositoryDisconnectResult result of the disconnect action. +type RepositoryDisconnectResult struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryDisconnectResult instantiates a new RepositoryDisconnectResult and sets the default values. +func NewRepositoryDisconnectResult() *RepositoryDisconnectResult { + m := &RepositoryDisconnectResult{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryDisconnectResultFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryDisconnectResultFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryDisconnectResult(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryDisconnectResult) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryDisconnectResult) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryDisconnectResult) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["warning"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWarning(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryDisconnectResult) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetWarning gets the warning property value. Optional warning from best-effort cleanup. +// returns a *string when successful +func (m *RepositoryDisconnectResult) GetWarning() *string { + val, err := m.GetBackingStore().Get("warning") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryDisconnectResult) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryDisconnectResult) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryDisconnectResult) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryDisconnectResult) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetWarning sets the warning property value. Optional warning from best-effort cleanup. +func (m *RepositoryDisconnectResult) SetWarning(value *string) { + err := m.GetBackingStore().Set("warning", value) + if err != nil { + panic(err) + } +} + +type RepositoryDisconnectResultable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetWarning() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetWarning(value *string) +} diff --git a/models/security/contentmanagement/repository_o_auth_credential.go b/models/security/contentmanagement/repository_o_auth_credential.go new file mode 100644 index 00000000000..fec337b7f75 --- /dev/null +++ b/models/security/contentmanagement/repository_o_auth_credential.go @@ -0,0 +1,245 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryOAuthCredential oAuth authorization-code credential. +type RepositoryOAuthCredential struct { + RepositoryAccessCredential +} + +// NewRepositoryOAuthCredential instantiates a new RepositoryOAuthCredential and sets the default values. +func NewRepositoryOAuthCredential() *RepositoryOAuthCredential { + m := &RepositoryOAuthCredential{ + RepositoryAccessCredential: *NewRepositoryAccessCredential(), + } + odataTypeValue := "#microsoft.graph.security.contentManagement.repositoryOAuthCredential" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreateRepositoryOAuthCredentialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryOAuthCredentialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryOAuthCredential(), nil +} + +// GetClientId gets the clientId property value. OAuth client id. +// returns a *string when successful +func (m *RepositoryOAuthCredential) GetClientId() *string { + val, err := m.GetBackingStore().Get("clientId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetCode gets the code property value. OAuth authorization code. +// returns a *string when successful +func (m *RepositoryOAuthCredential) GetCode() *string { + val, err := m.GetBackingStore().Get("code") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetCodeVerifier gets the codeVerifier property value. PKCE code verifier. +// returns a *string when successful +func (m *RepositoryOAuthCredential) GetCodeVerifier() *string { + val, err := m.GetBackingStore().Get("codeVerifier") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryOAuthCredential) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.RepositoryAccessCredential.GetFieldDeserializers() + res["clientId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["code"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCode(val) + } + return nil + } + res["codeVerifier"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCodeVerifier(val) + } + return nil + } + res["redirectUri"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRedirectUri(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} + +// GetRedirectUri gets the redirectUri property value. OAuth redirect URI. +// returns a *string when successful +func (m *RepositoryOAuthCredential) GetRedirectUri() *string { + val, err := m.GetBackingStore().Get("redirectUri") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetState gets the state property value. OAuth state value. +// returns a *string when successful +func (m *RepositoryOAuthCredential) GetState() *string { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryOAuthCredential) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.RepositoryAccessCredential.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("clientId", m.GetClientId()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("codeVerifier", m.GetCodeVerifier()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("redirectUri", m.GetRedirectUri()) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + return nil +} + +// SetClientId sets the clientId property value. OAuth client id. +func (m *RepositoryOAuthCredential) SetClientId(value *string) { + err := m.GetBackingStore().Set("clientId", value) + if err != nil { + panic(err) + } +} + +// SetCode sets the code property value. OAuth authorization code. +func (m *RepositoryOAuthCredential) SetCode(value *string) { + err := m.GetBackingStore().Set("code", value) + if err != nil { + panic(err) + } +} + +// SetCodeVerifier sets the codeVerifier property value. PKCE code verifier. +func (m *RepositoryOAuthCredential) SetCodeVerifier(value *string) { + err := m.GetBackingStore().Set("codeVerifier", value) + if err != nil { + panic(err) + } +} + +// SetRedirectUri sets the redirectUri property value. OAuth redirect URI. +func (m *RepositoryOAuthCredential) SetRedirectUri(value *string) { + err := m.GetBackingStore().Set("redirectUri", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. OAuth state value. +func (m *RepositoryOAuthCredential) SetState(value *string) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +type RepositoryOAuthCredentialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + RepositoryAccessCredentialable + GetClientId() *string + GetCode() *string + GetCodeVerifier() *string + GetRedirectUri() *string + GetState() *string + SetClientId(value *string) + SetCode(value *string) + SetCodeVerifier(value *string) + SetRedirectUri(value *string) + SetState(value *string) +} diff --git a/models/security/contentmanagement/repository_pat_credential.go b/models/security/contentmanagement/repository_pat_credential.go new file mode 100644 index 00000000000..3099fa99341 --- /dev/null +++ b/models/security/contentmanagement/repository_pat_credential.go @@ -0,0 +1,89 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryPatCredential personal access token credential. +type RepositoryPatCredential struct { + RepositoryAccessCredential +} + +// NewRepositoryPatCredential instantiates a new RepositoryPatCredential and sets the default values. +func NewRepositoryPatCredential() *RepositoryPatCredential { + m := &RepositoryPatCredential{ + RepositoryAccessCredential: *NewRepositoryAccessCredential(), + } + odataTypeValue := "#microsoft.graph.security.contentManagement.repositoryPatCredential" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreateRepositoryPatCredentialFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryPatCredentialFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryPatCredential(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryPatCredential) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.RepositoryAccessCredential.GetFieldDeserializers() + res["token"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} + +// GetToken gets the token property value. Personal access token. +// returns a *string when successful +func (m *RepositoryPatCredential) GetToken() *string { + val, err := m.GetBackingStore().Get("token") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryPatCredential) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.RepositoryAccessCredential.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("token", m.GetToken()) + if err != nil { + return err + } + } + return nil +} + +// SetToken sets the token property value. Personal access token. +func (m *RepositoryPatCredential) SetToken(value *string) { + err := m.GetBackingStore().Set("token", value) + if err != nil { + panic(err) + } +} + +type RepositoryPatCredentialable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + RepositoryAccessCredentialable + GetToken() *string + SetToken(value *string) +} diff --git a/models/security/contentmanagement/repository_pull_request.go b/models/security/contentmanagement/repository_pull_request.go new file mode 100644 index 00000000000..b4babc5f90a --- /dev/null +++ b/models/security/contentmanagement/repository_pull_request.go @@ -0,0 +1,200 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// RepositoryPullRequest the setup pull request opened for a repository connection. Read-only. +type RepositoryPullRequest struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryPullRequest instantiates a new RepositoryPullRequest and sets the default values. +func NewRepositoryPullRequest() *RepositoryPullRequest { + m := &RepositoryPullRequest{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryPullRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryPullRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryPullRequest(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryPullRequest) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryPullRequest) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryPullRequest) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryPullRequestState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*RepositoryPullRequestState)) + } + return nil + } + res["url"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryPullRequest) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetState gets the state property value. State of a setup pull request. +// returns a *RepositoryPullRequestState when successful +func (m *RepositoryPullRequest) GetState() *RepositoryPullRequestState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*RepositoryPullRequestState) + } + return nil +} + +// GetUrl gets the url property value. Pull request URL. +// returns a *string when successful +func (m *RepositoryPullRequest) GetUrl() *string { + val, err := m.GetBackingStore().Get("url") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryPullRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryPullRequest) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryPullRequest) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryPullRequest) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. State of a setup pull request. +func (m *RepositoryPullRequest) SetState(value *RepositoryPullRequestState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +// SetUrl sets the url property value. Pull request URL. +func (m *RepositoryPullRequest) SetUrl(value *string) { + err := m.GetBackingStore().Set("url", value) + if err != nil { + panic(err) + } +} + +type RepositoryPullRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetState() *RepositoryPullRequestState + GetUrl() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetState(value *RepositoryPullRequestState) + SetUrl(value *string) +} diff --git a/models/security/contentmanagement/repository_pull_request_state.go b/models/security/contentmanagement/repository_pull_request_state.go new file mode 100644 index 00000000000..5fc63120b41 --- /dev/null +++ b/models/security/contentmanagement/repository_pull_request_state.go @@ -0,0 +1,51 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// State of a setup pull request. +type RepositoryPullRequestState int + +const ( + // Pull request is open. + OPEN_REPOSITORYPULLREQUESTSTATE RepositoryPullRequestState = iota + // Pull request is closed. + CLOSED_REPOSITORYPULLREQUESTSTATE + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_REPOSITORYPULLREQUESTSTATE + // Pull request was merged. + MERGED_REPOSITORYPULLREQUESTSTATE +) + +func (i RepositoryPullRequestState) String() string { + return []string{"open", "closed", "unknownFutureValue", "merged"}[i] +} + +func ParseRepositoryPullRequestState(v string) (any, error) { + result := OPEN_REPOSITORYPULLREQUESTSTATE + switch v { + case "open": + result = OPEN_REPOSITORYPULLREQUESTSTATE + case "closed": + result = CLOSED_REPOSITORYPULLREQUESTSTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REPOSITORYPULLREQUESTSTATE + case "merged": + result = MERGED_REPOSITORYPULLREQUESTSTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeRepositoryPullRequestState(values []RepositoryPullRequestState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RepositoryPullRequestState) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/repository_service_principal.go b/models/security/contentmanagement/repository_service_principal.go new file mode 100644 index 00000000000..4aa887b9f07 --- /dev/null +++ b/models/security/contentmanagement/repository_service_principal.go @@ -0,0 +1,284 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// RepositoryServicePrincipal service principal / managed identity backing a repository connection. +type RepositoryServicePrincipal struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryServicePrincipal instantiates a new RepositoryServicePrincipal and sets the default values. +func NewRepositoryServicePrincipal() *RepositoryServicePrincipal { + m := &RepositoryServicePrincipal{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryServicePrincipalFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryServicePrincipalFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryServicePrincipal(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryServicePrincipal) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAppId gets the appId property value. Application (client) id of the identity. +// returns a *string when successful +func (m *RepositoryServicePrincipal) GetAppId() *string { + val, err := m.GetBackingStore().Get("appId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryServicePrincipal) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetCredentialsExpireDateTime gets the credentialsExpireDateTime property value. When the identity's credentials expire. +// returns a *Time when successful +func (m *RepositoryServicePrincipal) GetCredentialsExpireDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("credentialsExpireDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryServicePrincipal) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["appId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["credentialsExpireDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCredentialsExpireDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["servicePrincipalId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServicePrincipalId(val) + } + return nil + } + res["tenantId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTenantId(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryServicePrincipal) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetServicePrincipalId gets the servicePrincipalId property value. Object id of the service principal. +// returns a *string when successful +func (m *RepositoryServicePrincipal) GetServicePrincipalId() *string { + val, err := m.GetBackingStore().Get("servicePrincipalId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTenantId gets the tenantId property value. Tenant id that owns the identity. +// returns a *string when successful +func (m *RepositoryServicePrincipal) GetTenantId() *string { + val, err := m.GetBackingStore().Get("tenantId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryServicePrincipal) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("appId", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("credentialsExpireDateTime", m.GetCredentialsExpireDateTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("servicePrincipalId", m.GetServicePrincipalId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tenantId", m.GetTenantId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryServicePrincipal) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAppId sets the appId property value. Application (client) id of the identity. +func (m *RepositoryServicePrincipal) SetAppId(value *string) { + err := m.GetBackingStore().Set("appId", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryServicePrincipal) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetCredentialsExpireDateTime sets the credentialsExpireDateTime property value. When the identity's credentials expire. +func (m *RepositoryServicePrincipal) SetCredentialsExpireDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("credentialsExpireDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryServicePrincipal) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetServicePrincipalId sets the servicePrincipalId property value. Object id of the service principal. +func (m *RepositoryServicePrincipal) SetServicePrincipalId(value *string) { + err := m.GetBackingStore().Set("servicePrincipalId", value) + if err != nil { + panic(err) + } +} + +// SetTenantId sets the tenantId property value. Tenant id that owns the identity. +func (m *RepositoryServicePrincipal) SetTenantId(value *string) { + err := m.GetBackingStore().Set("tenantId", value) + if err != nil { + panic(err) + } +} + +type RepositoryServicePrincipalable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetCredentialsExpireDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetServicePrincipalId() *string + GetTenantId() *string + SetAppId(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetCredentialsExpireDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetServicePrincipalId(value *string) + SetTenantId(value *string) +} diff --git a/models/security/contentmanagement/repository_settings.go b/models/security/contentmanagement/repository_settings.go new file mode 100644 index 00000000000..2071af905b9 --- /dev/null +++ b/models/security/contentmanagement/repository_settings.go @@ -0,0 +1,277 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// RepositorySettings repository location settings. +type RepositorySettings struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositorySettings instantiates a new RepositorySettings and sets the default values. +func NewRepositorySettings() *RepositorySettings { + m := &RepositorySettings{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositorySettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositorySettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositorySettings(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositorySettings) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositorySettings) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetBranch gets the branch property value. Branch that content is deployed from. +// returns a *string when successful +func (m *RepositorySettings) GetBranch() *string { + val, err := m.GetBackingStore().Get("branch") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDeploymentLogsUrl gets the deploymentLogsUrl property value. URL where deployment logs can be viewed. Read-only. +// returns a *string when successful +func (m *RepositorySettings) GetDeploymentLogsUrl() *string { + val, err := m.GetBackingStore().Get("deploymentLogsUrl") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayUrl gets the displayUrl property value. Human-friendly display URL. +// returns a *string when successful +func (m *RepositorySettings) GetDisplayUrl() *string { + val, err := m.GetBackingStore().Get("displayUrl") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositorySettings) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["branch"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["deploymentLogsUrl"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentLogsUrl(val) + } + return nil + } + res["displayUrl"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayUrl(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["url"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositorySettings) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetUrl gets the url property value. Repository URL. +// returns a *string when successful +func (m *RepositorySettings) GetUrl() *string { + val, err := m.GetBackingStore().Get("url") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositorySettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("displayUrl", m.GetDisplayUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositorySettings) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositorySettings) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetBranch sets the branch property value. Branch that content is deployed from. +func (m *RepositorySettings) SetBranch(value *string) { + err := m.GetBackingStore().Set("branch", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentLogsUrl sets the deploymentLogsUrl property value. URL where deployment logs can be viewed. Read-only. +func (m *RepositorySettings) SetDeploymentLogsUrl(value *string) { + err := m.GetBackingStore().Set("deploymentLogsUrl", value) + if err != nil { + panic(err) + } +} + +// SetDisplayUrl sets the displayUrl property value. Human-friendly display URL. +func (m *RepositorySettings) SetDisplayUrl(value *string) { + err := m.GetBackingStore().Set("displayUrl", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositorySettings) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetUrl sets the url property value. Repository URL. +func (m *RepositorySettings) SetUrl(value *string) { + err := m.GetBackingStore().Set("url", value) + if err != nil { + panic(err) + } +} + +type RepositorySettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetBranch() *string + GetDeploymentLogsUrl() *string + GetDisplayUrl() *string + GetOdataType() *string + GetUrl() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetBranch(value *string) + SetDeploymentLogsUrl(value *string) + SetDisplayUrl(value *string) + SetOdataType(value *string) + SetUrl(value *string) +} diff --git a/models/security/contentmanagement/repository_type.go b/models/security/contentmanagement/repository_type.go new file mode 100644 index 00000000000..2c18aa93d3e --- /dev/null +++ b/models/security/contentmanagement/repository_type.go @@ -0,0 +1,47 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +// Source-control provider. +type RepositoryType int + +const ( + // GitHub. + GITHUB_REPOSITORYTYPE RepositoryType = iota + // Azure DevOps. + AZUREDEVOPS_REPOSITORYTYPE + // A marker value for members added after the release of this API. + UNKNOWNFUTUREVALUE_REPOSITORYTYPE +) + +func (i RepositoryType) String() string { + return []string{"gitHub", "azureDevOps", "unknownFutureValue"}[i] +} + +func ParseRepositoryType(v string) (any, error) { + result := GITHUB_REPOSITORYTYPE + switch v { + case "gitHub": + result = GITHUB_REPOSITORYTYPE + case "azureDevOps": + result = AZUREDEVOPS_REPOSITORYTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_REPOSITORYTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeRepositoryType(values []RepositoryType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i RepositoryType) isMultiValue() bool { + return false +} diff --git a/models/security/contentmanagement/repository_workload_identity_federation.go b/models/security/contentmanagement/repository_workload_identity_federation.go new file mode 100644 index 00000000000..889e045b5bd --- /dev/null +++ b/models/security/contentmanagement/repository_workload_identity_federation.go @@ -0,0 +1,322 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +// RepositoryWorkloadIdentityFederation workload identity federation details for a repository connection. +type RepositoryWorkloadIdentityFederation struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewRepositoryWorkloadIdentityFederation instantiates a new RepositoryWorkloadIdentityFederation and sets the default values. +func NewRepositoryWorkloadIdentityFederation() *RepositoryWorkloadIdentityFederation { + m := &RepositoryWorkloadIdentityFederation{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateRepositoryWorkloadIdentityFederationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryWorkloadIdentityFederationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryWorkloadIdentityFederation(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *RepositoryWorkloadIdentityFederation) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAppId gets the appId property value. Application (client) id of the parent application. +// returns a *string when successful +func (m *RepositoryWorkloadIdentityFederation) GetAppId() *string { + val, err := m.GetBackingStore().Get("appId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *RepositoryWorkloadIdentityFederation) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFederatedCredentialId gets the federatedCredentialId property value. Federated credential id. +// returns a *string when successful +func (m *RepositoryWorkloadIdentityFederation) GetFederatedCredentialId() *string { + val, err := m.GetBackingStore().Get("federatedCredentialId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *RepositoryWorkloadIdentityFederation) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["appId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["federatedCredentialId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFederatedCredentialId(val) + } + return nil + } + res["issuer"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuer(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["subject"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubject(val) + } + return nil + } + res["tenantId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTenantId(val) + } + return nil + } + return res +} + +// GetIssuer gets the issuer property value. Federated credential issuer. +// returns a *string when successful +func (m *RepositoryWorkloadIdentityFederation) GetIssuer() *string { + val, err := m.GetBackingStore().Get("issuer") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *RepositoryWorkloadIdentityFederation) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSubject gets the subject property value. Federated credential subject. +// returns a *string when successful +func (m *RepositoryWorkloadIdentityFederation) GetSubject() *string { + val, err := m.GetBackingStore().Get("subject") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetTenantId gets the tenantId property value. Tenant id that owns the parent application. +// returns a *string when successful +func (m *RepositoryWorkloadIdentityFederation) GetTenantId() *string { + val, err := m.GetBackingStore().Get("tenantId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *RepositoryWorkloadIdentityFederation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("appId", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("federatedCredentialId", m.GetFederatedCredentialId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issuer", m.GetIssuer()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subject", m.GetSubject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tenantId", m.GetTenantId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *RepositoryWorkloadIdentityFederation) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAppId sets the appId property value. Application (client) id of the parent application. +func (m *RepositoryWorkloadIdentityFederation) SetAppId(value *string) { + err := m.GetBackingStore().Set("appId", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *RepositoryWorkloadIdentityFederation) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetFederatedCredentialId sets the federatedCredentialId property value. Federated credential id. +func (m *RepositoryWorkloadIdentityFederation) SetFederatedCredentialId(value *string) { + err := m.GetBackingStore().Set("federatedCredentialId", value) + if err != nil { + panic(err) + } +} + +// SetIssuer sets the issuer property value. Federated credential issuer. +func (m *RepositoryWorkloadIdentityFederation) SetIssuer(value *string) { + err := m.GetBackingStore().Set("issuer", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *RepositoryWorkloadIdentityFederation) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetSubject sets the subject property value. Federated credential subject. +func (m *RepositoryWorkloadIdentityFederation) SetSubject(value *string) { + err := m.GetBackingStore().Set("subject", value) + if err != nil { + panic(err) + } +} + +// SetTenantId sets the tenantId property value. Tenant id that owns the parent application. +func (m *RepositoryWorkloadIdentityFederation) SetTenantId(value *string) { + err := m.GetBackingStore().Set("tenantId", value) + if err != nil { + panic(err) + } +} + +type RepositoryWorkloadIdentityFederationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetFederatedCredentialId() *string + GetIssuer() *string + GetOdataType() *string + GetSubject() *string + GetTenantId() *string + SetAppId(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetFederatedCredentialId(value *string) + SetIssuer(value *string) + SetOdataType(value *string) + SetSubject(value *string) + SetTenantId(value *string) +} diff --git a/models/security/contentmanagement/service_principal_deployment_identity.go b/models/security/contentmanagement/service_principal_deployment_identity.go new file mode 100644 index 00000000000..e712d768a33 --- /dev/null +++ b/models/security/contentmanagement/service_principal_deployment_identity.go @@ -0,0 +1,89 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ServicePrincipalDeploymentIdentity bring-your-own service principal. +type ServicePrincipalDeploymentIdentity struct { + DeploymentIdentity +} + +// NewServicePrincipalDeploymentIdentity instantiates a new ServicePrincipalDeploymentIdentity and sets the default values. +func NewServicePrincipalDeploymentIdentity() *ServicePrincipalDeploymentIdentity { + m := &ServicePrincipalDeploymentIdentity{ + DeploymentIdentity: *NewDeploymentIdentity(), + } + odataTypeValue := "#microsoft.graph.security.contentManagement.servicePrincipalDeploymentIdentity" + m.SetOdataType(&odataTypeValue) + return m +} + +// CreateServicePrincipalDeploymentIdentityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServicePrincipalDeploymentIdentityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServicePrincipalDeploymentIdentity(), nil +} + +// GetApplicationId gets the applicationId property value. Application (client) id of the customer-supplied service principal. +// returns a *string when successful +func (m *ServicePrincipalDeploymentIdentity) GetApplicationId() *string { + val, err := m.GetBackingStore().Get("applicationId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ServicePrincipalDeploymentIdentity) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.DeploymentIdentity.GetFieldDeserializers() + res["applicationId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetApplicationId(val) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *ServicePrincipalDeploymentIdentity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.DeploymentIdentity.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("applicationId", m.GetApplicationId()) + if err != nil { + return err + } + } + return nil +} + +// SetApplicationId sets the applicationId property value. Application (client) id of the customer-supplied service principal. +func (m *ServicePrincipalDeploymentIdentity) SetApplicationId(value *string) { + err := m.GetBackingStore().Set("applicationId", value) + if err != nil { + panic(err) + } +} + +type ServicePrincipalDeploymentIdentityable interface { + DeploymentIdentityable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApplicationId() *string + SetApplicationId(value *string) +} diff --git a/models/security/contentmanagement/system_data.go b/models/security/contentmanagement/system_data.go new file mode 100644 index 00000000000..cfeaba106f3 --- /dev/null +++ b/models/security/contentmanagement/system_data.go @@ -0,0 +1,326 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package contentmanagement + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// SystemData creation and last modification provenance for a connection. +type SystemData struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewSystemData instantiates a new SystemData and sets the default values. +func NewSystemData() *SystemData { + m := &SystemData{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateSystemDataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSystemDataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSystemData(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *SystemData) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *SystemData) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetCreatedBy gets the createdBy property value. Identifier of the identity that created the connection. +// returns a *string when successful +func (m *SystemData) GetCreatedBy() *string { + val, err := m.GetBackingStore().Get("createdBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetCreatedByType gets the createdByType property value. Type of identity that created the connection. +// returns a *string when successful +func (m *SystemData) GetCreatedByType() *string { + val, err := m.GetBackingStore().Get("createdByType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetCreatedDateTime gets the createdDateTime property value. UTC resource creation time. +// returns a *Time when successful +func (m *SystemData) GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("createdDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *SystemData) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["createdBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedBy(val) + } + return nil + } + res["createdByType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedByType(val) + } + return nil + } + res["createdDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedDateTime(val) + } + return nil + } + res["lastModifiedBy"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedBy(val) + } + return nil + } + res["lastModifiedByType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedByType(val) + } + return nil + } + res["lastModifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + return res +} + +// GetLastModifiedBy gets the lastModifiedBy property value. Identifier of the identity that last modified the connection. +// returns a *string when successful +func (m *SystemData) GetLastModifiedBy() *string { + val, err := m.GetBackingStore().Get("lastModifiedBy") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetLastModifiedByType gets the lastModifiedByType property value. Type of identity that last modified the connection. +// returns a *string when successful +func (m *SystemData) GetLastModifiedByType() *string { + val, err := m.GetBackingStore().Get("lastModifiedByType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetLastModifiedDateTime gets the lastModifiedDateTime property value. UTC time of the last effective modification. +// returns a *Time when successful +func (m *SystemData) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("lastModifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *SystemData) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *SystemData) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SystemData) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *SystemData) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetCreatedBy sets the createdBy property value. Identifier of the identity that created the connection. +func (m *SystemData) SetCreatedBy(value *string) { + err := m.GetBackingStore().Set("createdBy", value) + if err != nil { + panic(err) + } +} + +// SetCreatedByType sets the createdByType property value. Type of identity that created the connection. +func (m *SystemData) SetCreatedByType(value *string) { + err := m.GetBackingStore().Set("createdByType", value) + if err != nil { + panic(err) + } +} + +// SetCreatedDateTime sets the createdDateTime property value. UTC resource creation time. +func (m *SystemData) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("createdDateTime", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedBy sets the lastModifiedBy property value. Identifier of the identity that last modified the connection. +func (m *SystemData) SetLastModifiedBy(value *string) { + err := m.GetBackingStore().Set("lastModifiedBy", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedByType sets the lastModifiedByType property value. Type of identity that last modified the connection. +func (m *SystemData) SetLastModifiedByType(value *string) { + err := m.GetBackingStore().Set("lastModifiedByType", value) + if err != nil { + panic(err) + } +} + +// SetLastModifiedDateTime sets the lastModifiedDateTime property value. UTC time of the last effective modification. +func (m *SystemData) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("lastModifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *SystemData) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +type SystemDataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetCreatedBy() *string + GetCreatedByType() *string + GetCreatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetLastModifiedBy() *string + GetLastModifiedByType() *string + GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetCreatedBy(value *string) + SetCreatedByType(value *string) + SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastModifiedBy(value *string) + SetLastModifiedByType(value *string) + SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) +} diff --git a/models/security/rule_schedule.go b/models/security/rule_schedule.go index 12fe147b1c9..c378114d356 100644 --- a/models/security/rule_schedule.go +++ b/models/security/rule_schedule.go @@ -118,7 +118,7 @@ func (m *RuleSchedule) GetFrequency() *i878a80d2330e89d26896388a3f487eef27b0a0e6 return nil } -// GetLookback gets the lookback property value. The lookback property +// GetLookback gets the lookback property value. The time window evaluated by each scheduled rule run, expressed as an ISO 8601 duration, for example PT4H for four hours. Events match this window based on either event time or ingestion time. The value must be at least frequency. When omitted, the service derives the default lookback from frequency. Not supported for near-real-time rules with a zero frequency. // returns a *ISODuration when successful func (m *RuleSchedule) GetLookback() *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ISODuration { val, err := m.GetBackingStore().Get("lookback") @@ -232,7 +232,7 @@ func (m *RuleSchedule) SetFrequency(value *i878a80d2330e89d26896388a3f487eef27b0 } } -// SetLookback sets the lookback property value. The lookback property +// SetLookback sets the lookback property value. The time window evaluated by each scheduled rule run, expressed as an ISO 8601 duration, for example PT4H for four hours. Events match this window based on either event time or ingestion time. The value must be at least frequency. When omitted, the service derives the default lookback from frequency. Not supported for near-real-time rules with a zero frequency. func (m *RuleSchedule) SetLookback(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ISODuration) { err := m.GetBackingStore().Set("lookback", value) if err != nil { diff --git a/models/sensitive_content_evidence.go b/models/sensitive_content_evidence.go index 9997ff8f0a0..58668c1a58c 100644 --- a/models/sensitive_content_evidence.go +++ b/models/sensitive_content_evidence.go @@ -94,7 +94,7 @@ func (m *SensitiveContentEvidence) GetFieldDeserializers() map[string]func(i878a return res } -// GetLength gets the length property value. The length property +// GetLength gets the length property value. The length of the evidence text. // returns a *int32 when successful func (m *SensitiveContentEvidence) GetLength() *int32 { val, err := m.GetBackingStore().Get("length") @@ -107,7 +107,7 @@ func (m *SensitiveContentEvidence) GetLength() *int32 { return nil } -// GetMatch gets the match property value. The match property +// GetMatch gets the match property value. The matched evidence text. // returns a *string when successful func (m *SensitiveContentEvidence) GetMatch() *string { val, err := m.GetBackingStore().Get("match") @@ -133,7 +133,7 @@ func (m *SensitiveContentEvidence) GetOdataType() *string { return nil } -// GetOffset gets the offset property value. The offset property +// GetOffset gets the offset property value. The start position of the evidence text. // returns a *int32 when successful func (m *SensitiveContentEvidence) GetOffset() *int32 { val, err := m.GetBackingStore().Get("offset") @@ -194,7 +194,7 @@ func (m *SensitiveContentEvidence) SetBackingStore(value ie8677ce2c7e1b4c22e9c38 m.backingStore = value } -// SetLength sets the length property value. The length property +// SetLength sets the length property value. The length of the evidence text. func (m *SensitiveContentEvidence) SetLength(value *int32) { err := m.GetBackingStore().Set("length", value) if err != nil { @@ -202,7 +202,7 @@ func (m *SensitiveContentEvidence) SetLength(value *int32) { } } -// SetMatch sets the match property value. The match property +// SetMatch sets the match property value. The matched evidence text. func (m *SensitiveContentEvidence) SetMatch(value *string) { err := m.GetBackingStore().Set("match", value) if err != nil { @@ -218,7 +218,7 @@ func (m *SensitiveContentEvidence) SetOdataType(value *string) { } } -// SetOffset sets the offset property value. The offset property +// SetOffset sets the offset property value. The start position of the evidence text. func (m *SensitiveContentEvidence) SetOffset(value *int32) { err := m.GetBackingStore().Set("offset", value) if err != nil { diff --git a/models/service_principal.go b/models/service_principal.go index e62789ae258..299b44c8044 100644 --- a/models/service_principal.go +++ b/models/service_principal.go @@ -720,6 +720,16 @@ func (m *ServicePrincipal) GetFieldDeserializers() map[string]func(i878a80d2330e } return nil } + res["idJag"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdJagServicePrincipalConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIdJag(val.(IdJagServicePrincipalConfigurationable)) + } + return nil + } res["info"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetObjectValue(CreateInformationalUrlFromDiscriminatorValue) if err != nil { @@ -740,6 +750,16 @@ func (m *ServicePrincipal) GetFieldDeserializers() map[string]func(i878a80d2330e } return nil } + res["isHardDeleteProtectionEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsHardDeleteProtectionEnabled(val) + } + return nil + } res["keyCredentials"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(CreateKeyCredentialFromDiscriminatorValue) if err != nil { @@ -1185,6 +1205,19 @@ func (m *ServicePrincipal) GetHomeRealmDiscoveryPolicies() []HomeRealmDiscoveryP return nil } +// GetIdJag gets the idJag property value. The idJag property +// returns a IdJagServicePrincipalConfigurationable when successful +func (m *ServicePrincipal) GetIdJag() IdJagServicePrincipalConfigurationable { + val, err := m.GetBackingStore().Get("idJag") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdJagServicePrincipalConfigurationable) + } + return nil +} + // GetInfo gets the info property value. Basic profile information of the acquired application such as app's marketing, support, terms of service and privacy statement URLs. The terms of service and privacy statement are surfaced to users through the user consent experience. For more info, see How to: Add Terms of service and privacy statement for registered Microsoft Entra apps. Supports $filter (eq, ne, not, ge, le, and eq on null values). // returns a InformationalUrlable when successful func (m *ServicePrincipal) GetInfo() InformationalUrlable { @@ -1211,6 +1244,19 @@ func (m *ServicePrincipal) GetIsDisabled() *bool { return nil } +// GetIsHardDeleteProtectionEnabled gets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the service principal. When true, permanent deletion is blocked for seven days after soft deletion. The service principal can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing service principal by using Update servicePrincipal; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +// returns a *bool when successful +func (m *ServicePrincipal) GetIsHardDeleteProtectionEnabled() *bool { + val, err := m.GetBackingStore().Get("isHardDeleteProtectionEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + // GetKeyCredentials gets the keyCredentials property value. The collection of key credentials associated with the service principal. Not nullable. Supports $filter (eq, not, ge, le). // returns a []KeyCredentialable when successful func (m *ServicePrincipal) GetKeyCredentials() []KeyCredentialable { @@ -1861,6 +1907,12 @@ func (m *ServicePrincipal) Serialize(writer i878a80d2330e89d26896388a3f487eef27b return err } } + { + err = writer.WriteObjectValue("idJag", m.GetIdJag()) + if err != nil { + return err + } + } { err = writer.WriteObjectValue("info", m.GetInfo()) if err != nil { @@ -1873,6 +1925,12 @@ func (m *ServicePrincipal) Serialize(writer i878a80d2330e89d26896388a3f487eef27b return err } } + { + err = writer.WriteBoolValue("isHardDeleteProtectionEnabled", m.GetIsHardDeleteProtectionEnabled()) + if err != nil { + return err + } + } if m.GetKeyCredentials() != nil { cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetKeyCredentials())) for i, v := range m.GetKeyCredentials() { @@ -2356,6 +2414,14 @@ func (m *ServicePrincipal) SetHomeRealmDiscoveryPolicies(value []HomeRealmDiscov } } +// SetIdJag sets the idJag property value. The idJag property +func (m *ServicePrincipal) SetIdJag(value IdJagServicePrincipalConfigurationable) { + err := m.GetBackingStore().Set("idJag", value) + if err != nil { + panic(err) + } +} + // SetInfo sets the info property value. Basic profile information of the acquired application such as app's marketing, support, terms of service and privacy statement URLs. The terms of service and privacy statement are surfaced to users through the user consent experience. For more info, see How to: Add Terms of service and privacy statement for registered Microsoft Entra apps. Supports $filter (eq, ne, not, ge, le, and eq on null values). func (m *ServicePrincipal) SetInfo(value InformationalUrlable) { err := m.GetBackingStore().Set("info", value) @@ -2372,6 +2438,14 @@ func (m *ServicePrincipal) SetIsDisabled(value *bool) { } } +// SetIsHardDeleteProtectionEnabled sets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the service principal. When true, permanent deletion is blocked for seven days after soft deletion. The service principal can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing service principal by using Update servicePrincipal; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +func (m *ServicePrincipal) SetIsHardDeleteProtectionEnabled(value *bool) { + err := m.GetBackingStore().Set("isHardDeleteProtectionEnabled", value) + if err != nil { + panic(err) + } +} + // SetKeyCredentials sets the keyCredentials property value. The collection of key credentials associated with the service principal. Not nullable. Supports $filter (eq, not, ge, le). func (m *ServicePrincipal) SetKeyCredentials(value []KeyCredentialable) { err := m.GetBackingStore().Set("keyCredentials", value) @@ -2658,8 +2732,10 @@ type ServicePrincipalable interface { GetFederatedIdentityCredentials() []FederatedIdentityCredentialable GetHomepage() *string GetHomeRealmDiscoveryPolicies() []HomeRealmDiscoveryPolicyable + GetIdJag() IdJagServicePrincipalConfigurationable GetInfo() InformationalUrlable GetIsDisabled() *bool + GetIsHardDeleteProtectionEnabled() *bool GetKeyCredentials() []KeyCredentialable GetLicenseDetails() []LicenseDetailsable GetLoginUrl() *string @@ -2719,8 +2795,10 @@ type ServicePrincipalable interface { SetFederatedIdentityCredentials(value []FederatedIdentityCredentialable) SetHomepage(value *string) SetHomeRealmDiscoveryPolicies(value []HomeRealmDiscoveryPolicyable) + SetIdJag(value IdJagServicePrincipalConfigurationable) SetInfo(value InformationalUrlable) SetIsDisabled(value *bool) + SetIsHardDeleteProtectionEnabled(value *bool) SetKeyCredentials(value []KeyCredentialable) SetLicenseDetails(value []LicenseDetailsable) SetLoginUrl(value *string) diff --git a/models/service_principal_sign_in_activity.go b/models/service_principal_sign_in_activity.go index 9e3b095a6cd..c3300413433 100644 --- a/models/service_principal_sign_in_activity.go +++ b/models/service_principal_sign_in_activity.go @@ -38,7 +38,7 @@ func (m *ServicePrincipalSignInActivity) GetAppId() *string { return nil } -// GetApplicationAuthenticationClientSignInActivity gets the applicationAuthenticationClientSignInActivity property value. The sign-in activity of the application in a app-only authentication flow (app-to-app tokens) where the application acts like a client. +// GetApplicationAuthenticationClientSignInActivity gets the applicationAuthenticationClientSignInActivity property value. The sign-in activity reported as app-only authentication where the application acts as a client. Subject to the preview classification limitation described above. // returns a SignInActivityable when successful func (m *ServicePrincipalSignInActivity) GetApplicationAuthenticationClientSignInActivity() SignInActivityable { val, err := m.GetBackingStore().Get("applicationAuthenticationClientSignInActivity") @@ -51,7 +51,7 @@ func (m *ServicePrincipalSignInActivity) GetApplicationAuthenticationClientSignI return nil } -// GetApplicationAuthenticationResourceSignInActivity gets the applicationAuthenticationResourceSignInActivity property value. The sign-in activity of the application in a app-only authentication flow (app-to-app tokens) where the application acts like a resource. +// GetApplicationAuthenticationResourceSignInActivity gets the applicationAuthenticationResourceSignInActivity property value. The sign-in activity reported as app-only authentication where the application acts as a resource. Subject to the preview classification limitation described above. // returns a SignInActivityable when successful func (m *ServicePrincipalSignInActivity) GetApplicationAuthenticationResourceSignInActivity() SignInActivityable { val, err := m.GetBackingStore().Get("applicationAuthenticationResourceSignInActivity") @@ -223,7 +223,7 @@ func (m *ServicePrincipalSignInActivity) SetAppId(value *string) { } } -// SetApplicationAuthenticationClientSignInActivity sets the applicationAuthenticationClientSignInActivity property value. The sign-in activity of the application in a app-only authentication flow (app-to-app tokens) where the application acts like a client. +// SetApplicationAuthenticationClientSignInActivity sets the applicationAuthenticationClientSignInActivity property value. The sign-in activity reported as app-only authentication where the application acts as a client. Subject to the preview classification limitation described above. func (m *ServicePrincipalSignInActivity) SetApplicationAuthenticationClientSignInActivity(value SignInActivityable) { err := m.GetBackingStore().Set("applicationAuthenticationClientSignInActivity", value) if err != nil { @@ -231,7 +231,7 @@ func (m *ServicePrincipalSignInActivity) SetApplicationAuthenticationClientSignI } } -// SetApplicationAuthenticationResourceSignInActivity sets the applicationAuthenticationResourceSignInActivity property value. The sign-in activity of the application in a app-only authentication flow (app-to-app tokens) where the application acts like a resource. +// SetApplicationAuthenticationResourceSignInActivity sets the applicationAuthenticationResourceSignInActivity property value. The sign-in activity reported as app-only authentication where the application acts as a resource. Subject to the preview classification limitation described above. func (m *ServicePrincipalSignInActivity) SetApplicationAuthenticationResourceSignInActivity(value SignInActivityable) { err := m.GetBackingStore().Set("applicationAuthenticationResourceSignInActivity", value) if err != nil { diff --git a/models/task.go b/models/task.go index a34b3fdd824..345fb41d13b 100644 --- a/models/task.go +++ b/models/task.go @@ -26,7 +26,7 @@ func CreateTaskFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487ee return NewTask(), nil } -// GetArchivalInfo gets the archivalInfo property value. Information about whether the entity is archived, and when it was archived. +// GetArchivalInfo gets the archivalInfo property value. Service-populated information about whether the entity is archived, and when it was archived. Read-only. // returns a PlannerArchivalInfoable when successful func (m *Task) GetArchivalInfo() PlannerArchivalInfoable { val, err := m.GetBackingStore().Get("archivalInfo") @@ -65,7 +65,7 @@ func (m *Task) GetCapabilities() TaskCapabilityable { return nil } -// GetChecklist gets the checklist property value. The collection of checklist items on the task. Read-only. Nullable. +// GetChecklist gets the checklist property value. Checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a []ChecklistItemV4able when successful func (m *Task) GetChecklist() []ChecklistItemV4able { val, err := m.GetBackingStore().Get("checklist") @@ -78,7 +78,7 @@ func (m *Task) GetChecklist() []ChecklistItemV4able { return nil } -// GetCompletedBy gets the completedBy property value. Identity of the user who marked the task complete. +// GetCompletedBy gets the completedBy property value. Identity of the user who marked the task complete. Read-only. // returns a IdentitySetable when successful func (m *Task) GetCompletedBy() IdentitySetable { val, err := m.GetBackingStore().Get("completedBy") @@ -91,7 +91,7 @@ func (m *Task) GetCompletedBy() IdentitySetable { return nil } -// GetCompletedDateTime gets the completedDateTime property value. Date and time the task was completed. +// GetCompletedDateTime gets the completedDateTime property value. Date and time the task was completed. Read-only. // returns a *Time when successful func (m *Task) GetCompletedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { val, err := m.GetBackingStore().Get("completedDateTime") @@ -548,7 +548,7 @@ func (m *Task) GetGoalIds() []string { return nil } -// GetHasChat gets the hasChat property value. Indicates whether the task has an associated chat. +// GetHasChat gets the hasChat property value. Indicates whether the task has an associated chat. Read-only. // returns a *bool when successful func (m *Task) GetHasChat() *bool { val, err := m.GetBackingStore().Get("hasChat") @@ -561,7 +561,7 @@ func (m *Task) GetHasChat() *bool { return nil } -// GetHasChildren gets the hasChildren property value. Indicates whether the task has subtasks. +// GetHasChildren gets the hasChildren property value. Indicates whether the task has subtasks. Read-only. // returns a *bool when successful func (m *Task) GetHasChildren() *bool { val, err := m.GetBackingStore().Get("hasChildren") @@ -574,7 +574,7 @@ func (m *Task) GetHasChildren() *bool { return nil } -// GetIsCritical gets the isCritical property value. Indicates whether the task is on the critical path, as computed from its dependencies. +// GetIsCritical gets the isCritical property value. Indicates whether the task is on the critical path, as computed from its dependencies. Read-only. // returns a *bool when successful func (m *Task) GetIsCritical() *bool { val, err := m.GetBackingStore().Get("isCritical") @@ -613,7 +613,7 @@ func (m *Task) GetLastModifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f30 return nil } -// GetLinks gets the links property value. The collection of content links attached to the task. Read-only. Nullable. +// GetLinks gets the links property value. Content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a []ContentLinkable when successful func (m *Task) GetLinks() []ContentLinkable { val, err := m.GetBackingStore().Get("links") @@ -769,7 +769,7 @@ func (m *Task) GetStatus() *PlannerTaskStatus { return nil } -// GetUserAssignments gets the userAssignments property value. The collection of user assignments on the task. Read-only. Nullable. +// GetUserAssignments gets the userAssignments property value. User assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a []UserAssignmentable when successful func (m *Task) GetUserAssignments() []UserAssignmentable { val, err := m.GetBackingStore().Get("userAssignments") @@ -996,7 +996,7 @@ func (m *Task) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c49 return nil } -// SetArchivalInfo sets the archivalInfo property value. Information about whether the entity is archived, and when it was archived. +// SetArchivalInfo sets the archivalInfo property value. Service-populated information about whether the entity is archived, and when it was archived. Read-only. func (m *Task) SetArchivalInfo(value PlannerArchivalInfoable) { err := m.GetBackingStore().Set("archivalInfo", value) if err != nil { @@ -1020,7 +1020,7 @@ func (m *Task) SetCapabilities(value TaskCapabilityable) { } } -// SetChecklist sets the checklist property value. The collection of checklist items on the task. Read-only. Nullable. +// SetChecklist sets the checklist property value. Checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. func (m *Task) SetChecklist(value []ChecklistItemV4able) { err := m.GetBackingStore().Set("checklist", value) if err != nil { @@ -1028,7 +1028,7 @@ func (m *Task) SetChecklist(value []ChecklistItemV4able) { } } -// SetCompletedBy sets the completedBy property value. Identity of the user who marked the task complete. +// SetCompletedBy sets the completedBy property value. Identity of the user who marked the task complete. Read-only. func (m *Task) SetCompletedBy(value IdentitySetable) { err := m.GetBackingStore().Set("completedBy", value) if err != nil { @@ -1036,7 +1036,7 @@ func (m *Task) SetCompletedBy(value IdentitySetable) { } } -// SetCompletedDateTime sets the completedDateTime property value. Date and time the task was completed. +// SetCompletedDateTime sets the completedDateTime property value. Date and time the task was completed. Read-only. func (m *Task) SetCompletedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { err := m.GetBackingStore().Set("completedDateTime", value) if err != nil { @@ -1100,7 +1100,7 @@ func (m *Task) SetGoalIds(value []string) { } } -// SetHasChat sets the hasChat property value. Indicates whether the task has an associated chat. +// SetHasChat sets the hasChat property value. Indicates whether the task has an associated chat. Read-only. func (m *Task) SetHasChat(value *bool) { err := m.GetBackingStore().Set("hasChat", value) if err != nil { @@ -1108,7 +1108,7 @@ func (m *Task) SetHasChat(value *bool) { } } -// SetHasChildren sets the hasChildren property value. Indicates whether the task has subtasks. +// SetHasChildren sets the hasChildren property value. Indicates whether the task has subtasks. Read-only. func (m *Task) SetHasChildren(value *bool) { err := m.GetBackingStore().Set("hasChildren", value) if err != nil { @@ -1116,7 +1116,7 @@ func (m *Task) SetHasChildren(value *bool) { } } -// SetIsCritical sets the isCritical property value. Indicates whether the task is on the critical path, as computed from its dependencies. +// SetIsCritical sets the isCritical property value. Indicates whether the task is on the critical path, as computed from its dependencies. Read-only. func (m *Task) SetIsCritical(value *bool) { err := m.GetBackingStore().Set("isCritical", value) if err != nil { @@ -1140,7 +1140,7 @@ func (m *Task) SetLastModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a } } -// SetLinks sets the links property value. The collection of content links attached to the task. Read-only. Nullable. +// SetLinks sets the links property value. Content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. func (m *Task) SetLinks(value []ContentLinkable) { err := m.GetBackingStore().Set("links", value) if err != nil { @@ -1236,7 +1236,7 @@ func (m *Task) SetStatus(value *PlannerTaskStatus) { } } -// SetUserAssignments sets the userAssignments property value. The collection of user assignments on the task. Read-only. Nullable. +// SetUserAssignments sets the userAssignments property value. User assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. func (m *Task) SetUserAssignments(value []UserAssignmentable) { err := m.GetBackingStore().Set("userAssignments", value) if err != nil { diff --git a/models/teams_channel_planner.go b/models/teams_channel_planner.go index 5754ce295b2..24b18582a6e 100644 --- a/models/teams_channel_planner.go +++ b/models/teams_channel_planner.go @@ -77,7 +77,7 @@ func (m *TeamsChannelPlanner) GetPlans() []PlannerPlanable { return nil } -// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// GetPlansV2 gets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a []Planable when successful func (m *TeamsChannelPlanner) GetPlansV2() []Planable { val, err := m.GetBackingStore().Get("plans_v2") @@ -131,7 +131,7 @@ func (m *TeamsChannelPlanner) SetPlans(value []PlannerPlanable) { } } -// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// SetPlansV2 sets the plans_v2 property value. Read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. func (m *TeamsChannelPlanner) SetPlansV2(value []Planable) { err := m.GetBackingStore().Set("plans_v2", value) if err != nil { diff --git a/models/teamwork_channel_tag.go b/models/teamwork_channel_tag.go new file mode 100644 index 00000000000..fe75caa6adb --- /dev/null +++ b/models/teamwork_channel_tag.go @@ -0,0 +1,86 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamworkChannelTag struct { + TeamworkTag +} + +// NewTeamworkChannelTag instantiates a new TeamworkChannelTag and sets the default values. +func NewTeamworkChannelTag() *TeamworkChannelTag { + m := &TeamworkChannelTag{ + TeamworkTag: *NewTeamworkTag(), + } + return m +} + +// CreateTeamworkChannelTagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamworkChannelTagFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamworkChannelTag(), nil +} + +// GetChannelId gets the channelId property value. The identifier of the channel that owns the tag. Read-only. +// returns a *string when successful +func (m *TeamworkChannelTag) GetChannelId() *string { + val, err := m.GetBackingStore().Get("channelId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *TeamworkChannelTag) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.TeamworkTag.GetFieldDeserializers() + res["channelId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetChannelId(val) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *TeamworkChannelTag) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.TeamworkTag.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("channelId", m.GetChannelId()) + if err != nil { + return err + } + } + return nil +} + +// SetChannelId sets the channelId property value. The identifier of the channel that owns the tag. Read-only. +func (m *TeamworkChannelTag) SetChannelId(value *string) { + err := m.GetBackingStore().Set("channelId", value) + if err != nil { + panic(err) + } +} + +type TeamworkChannelTagable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + TeamworkTagable + GetChannelId() *string + SetChannelId(value *string) +} diff --git a/models/teamwork_channel_tag_collection_response.go b/models/teamwork_channel_tag_collection_response.go new file mode 100644 index 00000000000..70c106df5aa --- /dev/null +++ b/models/teamwork_channel_tag_collection_response.go @@ -0,0 +1,98 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamworkChannelTagCollectionResponse struct { + BaseCollectionPaginationCountResponse +} + +// NewTeamworkChannelTagCollectionResponse instantiates a new TeamworkChannelTagCollectionResponse and sets the default values. +func NewTeamworkChannelTagCollectionResponse() *TeamworkChannelTagCollectionResponse { + m := &TeamworkChannelTagCollectionResponse{ + BaseCollectionPaginationCountResponse: *NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamworkChannelTagCollectionResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *TeamworkChannelTagCollectionResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamworkChannelTagFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TeamworkChannelTagable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TeamworkChannelTagable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []TeamworkChannelTagable when successful +func (m *TeamworkChannelTagCollectionResponse) GetValue() []TeamworkChannelTagable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]TeamworkChannelTagable) + } + return nil +} + +// Serialize serializes information the current object +func (m *TeamworkChannelTagCollectionResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *TeamworkChannelTagCollectionResponse) SetValue(value []TeamworkChannelTagable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type TeamworkChannelTagCollectionResponseable interface { + BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []TeamworkChannelTagable + SetValue(value []TeamworkChannelTagable) +} diff --git a/models/teamwork_tag.go b/models/teamwork_tag.go index d9a8e9f8f37..516a897dfa7 100644 --- a/models/teamwork_tag.go +++ b/models/teamwork_tag.go @@ -22,6 +22,24 @@ func NewTeamworkTag() *TeamworkTag { // CreateTeamworkTagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful func CreateTeamworkTagFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("@odata.type") + if err != nil { + return nil, err + } + if mappingValueNode != nil { + mappingValue, err := mappingValueNode.GetStringValue() + if err != nil { + return nil, err + } + if mappingValue != nil { + switch *mappingValue { + case "#microsoft.graph.teamworkChannelTag": + return NewTeamworkChannelTag(), nil + } + } + } + } return NewTeamworkTag(), nil } @@ -150,7 +168,7 @@ func (m *TeamworkTag) GetMembers() []TeamworkTagMemberable { return nil } -// GetTagType gets the tagType property value. The type of tag. Default is standard. +// GetTagType gets the tagType property value. The type of tag. The possible values are: standard, unknownFutureValue. The default value is standard. // returns a *TeamworkTagType when successful func (m *TeamworkTag) GetTagType() *TeamworkTagType { val, err := m.GetBackingStore().Get("tagType") @@ -260,7 +278,7 @@ func (m *TeamworkTag) SetMembers(value []TeamworkTagMemberable) { } } -// SetTagType sets the tagType property value. The type of tag. Default is standard. +// SetTagType sets the tagType property value. The type of tag. The possible values are: standard, unknownFutureValue. The default value is standard. func (m *TeamworkTag) SetTagType(value *TeamworkTagType) { err := m.GetBackingStore().Set("tagType", value) if err != nil { diff --git a/models/teamwork_tag_member.go b/models/teamwork_tag_member.go index b7c7125a082..22be822e1aa 100644 --- a/models/teamwork_tag_member.go +++ b/models/teamwork_tag_member.go @@ -25,7 +25,7 @@ func CreateTeamworkTagMemberFromDiscriminatorValue(parseNode i878a80d2330e89d268 return NewTeamworkTagMember(), nil } -// GetDisplayName gets the displayName property value. The member's display name. +// GetDisplayName gets the displayName property value. The member's display name. For channel-owned tags, the value can be null if the user can't be resolved. // returns a *string when successful func (m *TeamworkTagMember) GetDisplayName() *string { val, err := m.GetBackingStore().Get("displayName") @@ -75,7 +75,7 @@ func (m *TeamworkTagMember) GetFieldDeserializers() map[string]func(i878a80d2330 return res } -// GetTenantId gets the tenantId property value. The ID of the tenant that the tag member is a part of. +// GetTenantId gets the tenantId property value. The ID of the tenant that the tag member is a part of. For channel-owned tags, this is the request tenant, not a separately resolved home tenant. // returns a *string when successful func (m *TeamworkTagMember) GetTenantId() *string { val, err := m.GetBackingStore().Get("tenantId") @@ -128,7 +128,7 @@ func (m *TeamworkTagMember) Serialize(writer i878a80d2330e89d26896388a3f487eef27 return nil } -// SetDisplayName sets the displayName property value. The member's display name. +// SetDisplayName sets the displayName property value. The member's display name. For channel-owned tags, the value can be null if the user can't be resolved. func (m *TeamworkTagMember) SetDisplayName(value *string) { err := m.GetBackingStore().Set("displayName", value) if err != nil { @@ -136,7 +136,7 @@ func (m *TeamworkTagMember) SetDisplayName(value *string) { } } -// SetTenantId sets the tenantId property value. The ID of the tenant that the tag member is a part of. +// SetTenantId sets the tenantId property value. The ID of the tenant that the tag member is a part of. For channel-owned tags, this is the request tenant, not a separately resolved home tenant. func (m *TeamworkTagMember) SetTenantId(value *string) { err := m.GetBackingStore().Set("tenantId", value) if err != nil { diff --git a/models/user.go b/models/user.go index 14f937b1692..93c7da83a5c 100644 --- a/models/user.go +++ b/models/user.go @@ -1670,6 +1670,16 @@ func (m *User) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a } return nil } + res["identityVerificationStatus"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIdentityVerificationStatusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIdentityVerificationStatus(val.(IdentityVerificationStatusable)) + } + return nil + } res["imAddresses"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfPrimitiveValues("string") if err != nil { @@ -1758,6 +1768,16 @@ func (m *User) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a } return nil } + res["isHardDeleteProtectionEnabled"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsHardDeleteProtectionEnabled(val) + } + return nil + } res["isLicenseReconciliationNeeded"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetBoolValue() if err != nil { @@ -2951,7 +2971,7 @@ func (m *User) GetIdentities() []ObjectIdentityable { return nil } -// GetIdentityGovernance gets the identityGovernance property value. The identity governance settings for the user. You can get or update the user's approver delegate through the approverDelegate property. Nullable. Returned only on $select. Supports $expand. +// GetIdentityGovernance gets the identityGovernance property value. The identity governance settings for the user, including the approver delegate configuration. You can get or update the user's approver delegate through the approverDelegate property. Nullable. Returned only on $select. Supports $expand. // returns a IdentityGovernanceUserSettingsable when successful func (m *User) GetIdentityGovernance() IdentityGovernanceUserSettingsable { val, err := m.GetBackingStore().Get("identityGovernance") @@ -2977,6 +2997,19 @@ func (m *User) GetIdentityParentId() *string { return nil } +// GetIdentityVerificationStatus gets the identityVerificationStatus property value. The user's overall identity verification state and recent verification events. Retrieve through the get identity verification status operation. +// returns a IdentityVerificationStatusable when successful +func (m *User) GetIdentityVerificationStatus() IdentityVerificationStatusable { + val, err := m.GetBackingStore().Get("identityVerificationStatus") + if err != nil { + panic(err) + } + if val != nil { + return val.(IdentityVerificationStatusable) + } + return nil +} + // GetImAddresses gets the imAddresses property value. The instant message voice-over IP (VOIP) session initiation protocol (SIP) addresses for the user. Read-only. Supports $filter (eq, not, ge, le, startsWith). // returns a []string when successful func (m *User) GetImAddresses() []string { @@ -3068,6 +3101,19 @@ func (m *User) GetInvitedBy() DirectoryObjectable { return nil } +// GetIsHardDeleteProtectionEnabled gets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the user (excluding on-premises synchronized users). When true, permanent deletion is blocked for seven days after soft deletion. The user can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing user by using Update user; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +// returns a *bool when successful +func (m *User) GetIsHardDeleteProtectionEnabled() *bool { + val, err := m.GetBackingStore().Get("isHardDeleteProtectionEnabled") + if err != nil { + panic(err) + } + if val != nil { + return val.(*bool) + } + return nil +} + // GetIsLicenseReconciliationNeeded gets the isLicenseReconciliationNeeded property value. Indicates whether the user is pending an exchange mailbox license assignment. Read-only. Supports $filter (eq where true only). // returns a *bool when successful func (m *User) GetIsLicenseReconciliationNeeded() *bool { @@ -4827,6 +4873,12 @@ func (m *User) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c49 return err } } + { + err = writer.WriteObjectValue("identityVerificationStatus", m.GetIdentityVerificationStatus()) + if err != nil { + return err + } + } if m.GetImAddresses() != nil { err = writer.WriteCollectionOfStringValues("imAddresses", m.GetImAddresses()) if err != nil { @@ -4869,6 +4921,12 @@ func (m *User) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c49 return err } } + { + err = writer.WriteBoolValue("isHardDeleteProtectionEnabled", m.GetIsHardDeleteProtectionEnabled()) + if err != nil { + return err + } + } { err = writer.WriteBoolValue("isLicenseReconciliationNeeded", m.GetIsLicenseReconciliationNeeded()) if err != nil { @@ -6122,7 +6180,7 @@ func (m *User) SetIdentities(value []ObjectIdentityable) { } } -// SetIdentityGovernance sets the identityGovernance property value. The identity governance settings for the user. You can get or update the user's approver delegate through the approverDelegate property. Nullable. Returned only on $select. Supports $expand. +// SetIdentityGovernance sets the identityGovernance property value. The identity governance settings for the user, including the approver delegate configuration. You can get or update the user's approver delegate through the approverDelegate property. Nullable. Returned only on $select. Supports $expand. func (m *User) SetIdentityGovernance(value IdentityGovernanceUserSettingsable) { err := m.GetBackingStore().Set("identityGovernance", value) if err != nil { @@ -6138,6 +6196,14 @@ func (m *User) SetIdentityParentId(value *string) { } } +// SetIdentityVerificationStatus sets the identityVerificationStatus property value. The user's overall identity verification state and recent verification events. Retrieve through the get identity verification status operation. +func (m *User) SetIdentityVerificationStatus(value IdentityVerificationStatusable) { + err := m.GetBackingStore().Set("identityVerificationStatus", value) + if err != nil { + panic(err) + } +} + // SetImAddresses sets the imAddresses property value. The instant message voice-over IP (VOIP) session initiation protocol (SIP) addresses for the user. Read-only. Supports $filter (eq, not, ge, le, startsWith). func (m *User) SetImAddresses(value []string) { err := m.GetBackingStore().Set("imAddresses", value) @@ -6194,6 +6260,14 @@ func (m *User) SetInvitedBy(value DirectoryObjectable) { } } +// SetIsHardDeleteProtectionEnabled sets the isHardDeleteProtectionEnabled property value. Indicates whether hard deletion protection is enabled for the user (excluding on-premises synchronized users). When true, permanent deletion is blocked for seven days after soft deletion. The user can still be soft deleted and restored. Once enabled, protection can't be disabled or set to null. Enable protection on an existing user by using Update user; enabling it during creation isn't supported. Setting this property to true requires the Microsoft Entra Backup Administrator role. Nullable. Requires $select to retrieve. Supports $filter (eq). +func (m *User) SetIsHardDeleteProtectionEnabled(value *bool) { + err := m.GetBackingStore().Set("isHardDeleteProtectionEnabled", value) + if err != nil { + panic(err) + } +} + // SetIsLicenseReconciliationNeeded sets the isLicenseReconciliationNeeded property value. Indicates whether the user is pending an exchange mailbox license assignment. Read-only. Supports $filter (eq where true only). func (m *User) SetIsLicenseReconciliationNeeded(value *bool) { err := m.GetBackingStore().Set("isLicenseReconciliationNeeded", value) @@ -6991,6 +7065,7 @@ type Userable interface { GetIdentities() []ObjectIdentityable GetIdentityGovernance() IdentityGovernanceUserSettingsable GetIdentityParentId() *string + GetIdentityVerificationStatus() IdentityVerificationStatusable GetImAddresses() []string GetInferenceClassification() InferenceClassificationable GetInfoCatalogs() []string @@ -6998,6 +7073,7 @@ type Userable interface { GetInsights() ItemInsightsable GetInterests() []string GetInvitedBy() DirectoryObjectable + GetIsHardDeleteProtectionEnabled() *bool GetIsLicenseReconciliationNeeded() *bool GetIsManagementRestricted() *bool GetIsResourceAccount() *bool @@ -7155,6 +7231,7 @@ type Userable interface { SetIdentities(value []ObjectIdentityable) SetIdentityGovernance(value IdentityGovernanceUserSettingsable) SetIdentityParentId(value *string) + SetIdentityVerificationStatus(value IdentityVerificationStatusable) SetImAddresses(value []string) SetInferenceClassification(value InferenceClassificationable) SetInfoCatalogs(value []string) @@ -7162,6 +7239,7 @@ type Userable interface { SetInsights(value ItemInsightsable) SetInterests(value []string) SetInvitedBy(value DirectoryObjectable) + SetIsHardDeleteProtectionEnabled(value *bool) SetIsLicenseReconciliationNeeded(value *bool) SetIsManagementRestricted(value *bool) SetIsResourceAccount(value *bool) diff --git a/models/user_action_exclusion.go b/models/user_action_exclusion.go new file mode 100644 index 00000000000..9fc14b5848e --- /dev/null +++ b/models/user_action_exclusion.go @@ -0,0 +1,205 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type UserActionExclusion struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewUserActionExclusion instantiates a new UserActionExclusion and sets the default values. +func NewUserActionExclusion() *UserActionExclusion { + m := &UserActionExclusion{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateUserActionExclusionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserActionExclusionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserActionExclusion(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *UserActionExclusion) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *UserActionExclusion) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *UserActionExclusion) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseConditionalAccessPolicyState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ConditionalAccessPolicyState)) + } + return nil + } + res["userAction"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserAction(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *UserActionExclusion) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetState gets the state property value. The state property +// returns a *ConditionalAccessPolicyState when successful +func (m *UserActionExclusion) GetState() *ConditionalAccessPolicyState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*ConditionalAccessPolicyState) + } + return nil +} + +// GetUserAction gets the userAction property value. The user action identifier, for example, accountrecovery. +// returns a *string when successful +func (m *UserActionExclusion) GetUserAction() *string { + val, err := m.GetBackingStore().Get("userAction") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *UserActionExclusion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("userAction", m.GetUserAction()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *UserActionExclusion) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *UserActionExclusion) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *UserActionExclusion) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. The state property +func (m *UserActionExclusion) SetState(value *ConditionalAccessPolicyState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +// SetUserAction sets the userAction property value. The user action identifier, for example, accountrecovery. +func (m *UserActionExclusion) SetUserAction(value *string) { + err := m.GetBackingStore().Set("userAction", value) + if err != nil { + panic(err) + } +} + +type UserActionExclusionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetState() *ConditionalAccessPolicyState + GetUserAction() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetState(value *ConditionalAccessPolicyState) + SetUserAction(value *string) +} diff --git a/models/user_assignment.go b/models/user_assignment.go index 7f98abf0a0e..b0b6a261bd1 100644 --- a/models/user_assignment.go +++ b/models/user_assignment.go @@ -26,7 +26,7 @@ func CreateUserAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d268963 return NewUserAssignment(), nil } -// GetAssignedBy gets the assignedBy property value. Identity of the user (or application) that made the assignment. +// GetAssignedBy gets the assignedBy property value. Identity of the user (or application) that made the assignment. Read-only. // returns a IdentitySetable when successful func (m *UserAssignment) GetAssignedBy() IdentitySetable { val, err := m.GetBackingStore().Get("assignedBy") @@ -39,7 +39,7 @@ func (m *UserAssignment) GetAssignedBy() IdentitySetable { return nil } -// GetAssignedDateTime gets the assignedDateTime property value. Date and time the assignment was made. +// GetAssignedDateTime gets the assignedDateTime property value. Date and time the assignment was made. Read-only. // returns a *Time when successful func (m *UserAssignment) GetAssignedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { val, err := m.GetBackingStore().Get("assignedDateTime") @@ -152,7 +152,7 @@ func (m *UserAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a return nil } -// SetAssignedBy sets the assignedBy property value. Identity of the user (or application) that made the assignment. +// SetAssignedBy sets the assignedBy property value. Identity of the user (or application) that made the assignment. Read-only. func (m *UserAssignment) SetAssignedBy(value IdentitySetable) { err := m.GetBackingStore().Set("assignedBy", value) if err != nil { @@ -160,7 +160,7 @@ func (m *UserAssignment) SetAssignedBy(value IdentitySetable) { } } -// SetAssignedDateTime sets the assignedDateTime property value. Date and time the assignment was made. +// SetAssignedDateTime sets the assignedDateTime property value. Date and time the assignment was made. Read-only. func (m *UserAssignment) SetAssignedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { err := m.GetBackingStore().Set("assignedDateTime", value) if err != nil { diff --git a/models/verification_actor_type.go b/models/verification_actor_type.go new file mode 100644 index 00000000000..4f35fc08a7d --- /dev/null +++ b/models/verification_actor_type.go @@ -0,0 +1,43 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type VerificationActorType int + +const ( + USER_VERIFICATIONACTORTYPE VerificationActorType = iota + APPLICATION_VERIFICATIONACTORTYPE + UNKNOWNFUTUREVALUE_VERIFICATIONACTORTYPE +) + +func (i VerificationActorType) String() string { + return []string{"user", "application", "unknownFutureValue"}[i] +} + +func ParseVerificationActorType(v string) (any, error) { + result := USER_VERIFICATIONACTORTYPE + switch v { + case "user": + result = USER_VERIFICATIONACTORTYPE + case "application": + result = APPLICATION_VERIFICATIONACTORTYPE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_VERIFICATIONACTORTYPE + default: + return nil, nil + } + return &result, nil +} + +func SerializeVerificationActorType(values []VerificationActorType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i VerificationActorType) isMultiValue() bool { + return false +} diff --git a/models/verification_event_detail.go b/models/verification_event_detail.go new file mode 100644 index 00000000000..a9b4e293eb5 --- /dev/null +++ b/models/verification_event_detail.go @@ -0,0 +1,402 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// VerificationEventDetail verification details for an identity verification event, including the provider and temporal metadata. +type VerificationEventDetail struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewVerificationEventDetail instantiates a new VerificationEventDetail and sets the default values. +func NewVerificationEventDetail() *VerificationEventDetail { + m := &VerificationEventDetail{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateVerificationEventDetailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVerificationEventDetailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVerificationEventDetail(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *VerificationEventDetail) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *VerificationEventDetail) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetExpiresDateTime gets the expiresDateTime property value. The date and time when this verification expires, in ISO 8601 format. Must be after verifiedDateTime. Compare this value with the current time to determine expiry. Immutable. +// returns a *Time when successful +func (m *VerificationEventDetail) GetExpiresDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("expiresDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetExternalCredentialId gets the externalCredentialId property value. The unique credential reference in URN format, such as urn:pic:73b78a00-5b9e-4f8c-85dd-b60a08dc1123. Used for deduplication so repeated presentation of the same credential produces one event. Maximum 256 characters. Immutable. +// returns a *string when successful +func (m *VerificationEventDetail) GetExternalCredentialId() *string { + val, err := m.GetBackingStore().Get("externalCredentialId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *VerificationEventDetail) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["expiresDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresDateTime(val) + } + return nil + } + res["externalCredentialId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalCredentialId(val) + } + return nil + } + res["issuedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuedDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["source"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseVerificationState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*VerificationState)) + } + return nil + } + res["verifiedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetVerifiedDateTime(val) + } + return nil + } + res["verifiedIdProfileId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVerifiedIdProfileId(val) + } + return nil + } + return res +} + +// GetIssuedDateTime gets the issuedDateTime property value. The date and time when the provider issued the underlying credential, in ISO 8601 format. Must not be in the future. Distinct from verifiedDateTime. Immutable. +// returns a *Time when successful +func (m *VerificationEventDetail) GetIssuedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("issuedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *VerificationEventDetail) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSource gets the source property value. The verification provider or attestation authority, such as Contoso Identity Services. May be null when state is issued. Maximum 200 characters. Immutable. +// returns a *string when successful +func (m *VerificationEventDetail) GetSource() *string { + val, err := m.GetBackingStore().Get("source") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetState gets the state property value. The state property +// returns a *VerificationState when successful +func (m *VerificationEventDetail) GetState() *VerificationState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*VerificationState) + } + return nil +} + +// GetVerifiedDateTime gets the verifiedDateTime property value. The date and time when identity verification was performed, in ISO 8601 format. Must not be in the future. May be null when state is issued. Immutable. +// returns a *Time when successful +func (m *VerificationEventDetail) GetVerifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("verifiedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetVerifiedIdProfileId gets the verifiedIdProfileId property value. The identifier of the verified identity profile in the provider's system, in UUID format. Immutable. +// returns a *string when successful +func (m *VerificationEventDetail) GetVerifiedIdProfileId() *string { + val, err := m.GetBackingStore().Get("verifiedIdProfileId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *VerificationEventDetail) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteTimeValue("expiresDateTime", m.GetExpiresDateTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("externalCredentialId", m.GetExternalCredentialId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("issuedDateTime", m.GetIssuedDateTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("verifiedDateTime", m.GetVerifiedDateTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("verifiedIdProfileId", m.GetVerifiedIdProfileId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *VerificationEventDetail) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *VerificationEventDetail) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetExpiresDateTime sets the expiresDateTime property value. The date and time when this verification expires, in ISO 8601 format. Must be after verifiedDateTime. Compare this value with the current time to determine expiry. Immutable. +func (m *VerificationEventDetail) SetExpiresDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("expiresDateTime", value) + if err != nil { + panic(err) + } +} + +// SetExternalCredentialId sets the externalCredentialId property value. The unique credential reference in URN format, such as urn:pic:73b78a00-5b9e-4f8c-85dd-b60a08dc1123. Used for deduplication so repeated presentation of the same credential produces one event. Maximum 256 characters. Immutable. +func (m *VerificationEventDetail) SetExternalCredentialId(value *string) { + err := m.GetBackingStore().Set("externalCredentialId", value) + if err != nil { + panic(err) + } +} + +// SetIssuedDateTime sets the issuedDateTime property value. The date and time when the provider issued the underlying credential, in ISO 8601 format. Must not be in the future. Distinct from verifiedDateTime. Immutable. +func (m *VerificationEventDetail) SetIssuedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("issuedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *VerificationEventDetail) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetSource sets the source property value. The verification provider or attestation authority, such as Contoso Identity Services. May be null when state is issued. Maximum 200 characters. Immutable. +func (m *VerificationEventDetail) SetSource(value *string) { + err := m.GetBackingStore().Set("source", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. The state property +func (m *VerificationEventDetail) SetState(value *VerificationState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +// SetVerifiedDateTime sets the verifiedDateTime property value. The date and time when identity verification was performed, in ISO 8601 format. Must not be in the future. May be null when state is issued. Immutable. +func (m *VerificationEventDetail) SetVerifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("verifiedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetVerifiedIdProfileId sets the verifiedIdProfileId property value. The identifier of the verified identity profile in the provider's system, in UUID format. Immutable. +func (m *VerificationEventDetail) SetVerifiedIdProfileId(value *string) { + err := m.GetBackingStore().Set("verifiedIdProfileId", value) + if err != nil { + panic(err) + } +} + +type VerificationEventDetailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetExpiresDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetExternalCredentialId() *string + GetIssuedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetSource() *string + GetState() *VerificationState + GetVerifiedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetVerifiedIdProfileId() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetExpiresDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetExternalCredentialId(value *string) + SetIssuedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetSource(value *string) + SetState(value *VerificationState) + SetVerifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetVerifiedIdProfileId(value *string) +} diff --git a/models/verification_event_lifecycle.go b/models/verification_event_lifecycle.go new file mode 100644 index 00000000000..5a6a3f80c8f --- /dev/null +++ b/models/verification_event_lifecycle.go @@ -0,0 +1,241 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// VerificationEventLifecycle lifecycle tracking for a verification event, indicating who triggered it and its current state. +type VerificationEventLifecycle struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewVerificationEventLifecycle instantiates a new VerificationEventLifecycle and sets the default values. +func NewVerificationEventLifecycle() *VerificationEventLifecycle { + m := &VerificationEventLifecycle{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateVerificationEventLifecycleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVerificationEventLifecycleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVerificationEventLifecycle(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *VerificationEventLifecycle) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *VerificationEventLifecycle) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *VerificationEventLifecycle) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["invalidatedDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetInvalidatedDateTime(val) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["source"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseVerificationLifecycleSource) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(*VerificationLifecycleSource)) + } + return nil + } + res["state"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseVerificationEventLifecycleState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*VerificationEventLifecycleState)) + } + return nil + } + return res +} + +// GetInvalidatedDateTime gets the invalidatedDateTime property value. The service-populated timestamp for an event in the invalidated lifecycle state. Otherwise, null. Read-only. +// returns a *Time when successful +func (m *VerificationEventLifecycle) GetInvalidatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("invalidatedDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *VerificationEventLifecycle) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetSource gets the source property value. The source property +// returns a *VerificationLifecycleSource when successful +func (m *VerificationEventLifecycle) GetSource() *VerificationLifecycleSource { + val, err := m.GetBackingStore().Get("source") + if err != nil { + panic(err) + } + if val != nil { + return val.(*VerificationLifecycleSource) + } + return nil +} + +// GetState gets the state property value. The state property +// returns a *VerificationEventLifecycleState when successful +func (m *VerificationEventLifecycle) GetState() *VerificationEventLifecycleState { + val, err := m.GetBackingStore().Get("state") + if err != nil { + panic(err) + } + if val != nil { + return val.(*VerificationEventLifecycleState) + } + return nil +} + +// Serialize serializes information the current object +func (m *VerificationEventLifecycle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + if m.GetSource() != nil { + cast := (*m.GetSource()).String() + err := writer.WriteStringValue("source", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *VerificationEventLifecycle) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *VerificationEventLifecycle) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetInvalidatedDateTime sets the invalidatedDateTime property value. The service-populated timestamp for an event in the invalidated lifecycle state. Otherwise, null. Read-only. +func (m *VerificationEventLifecycle) SetInvalidatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("invalidatedDateTime", value) + if err != nil { + panic(err) + } +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *VerificationEventLifecycle) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetSource sets the source property value. The source property +func (m *VerificationEventLifecycle) SetSource(value *VerificationLifecycleSource) { + err := m.GetBackingStore().Set("source", value) + if err != nil { + panic(err) + } +} + +// SetState sets the state property value. The state property +func (m *VerificationEventLifecycle) SetState(value *VerificationEventLifecycleState) { + err := m.GetBackingStore().Set("state", value) + if err != nil { + panic(err) + } +} + +type VerificationEventLifecycleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetInvalidatedDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetOdataType() *string + GetSource() *VerificationLifecycleSource + GetState() *VerificationEventLifecycleState + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetInvalidatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetOdataType(value *string) + SetSource(value *VerificationLifecycleSource) + SetState(value *VerificationEventLifecycleState) +} diff --git a/models/verification_event_lifecycle_state.go b/models/verification_event_lifecycle_state.go new file mode 100644 index 00000000000..5da9d8d3a0d --- /dev/null +++ b/models/verification_event_lifecycle_state.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type VerificationEventLifecycleState int + +const ( + ACTIVE_VERIFICATIONEVENTLIFECYCLESTATE VerificationEventLifecycleState = iota + REVOKED_VERIFICATIONEVENTLIFECYCLESTATE + SUSPENDED_VERIFICATIONEVENTLIFECYCLESTATE + INVALIDATED_VERIFICATIONEVENTLIFECYCLESTATE + ISSUED_VERIFICATIONEVENTLIFECYCLESTATE + BLOCKED_VERIFICATIONEVENTLIFECYCLESTATE + UNKNOWNFUTUREVALUE_VERIFICATIONEVENTLIFECYCLESTATE +) + +func (i VerificationEventLifecycleState) String() string { + return []string{"active", "revoked", "suspended", "invalidated", "issued", "blocked", "unknownFutureValue"}[i] +} + +func ParseVerificationEventLifecycleState(v string) (any, error) { + result := ACTIVE_VERIFICATIONEVENTLIFECYCLESTATE + switch v { + case "active": + result = ACTIVE_VERIFICATIONEVENTLIFECYCLESTATE + case "revoked": + result = REVOKED_VERIFICATIONEVENTLIFECYCLESTATE + case "suspended": + result = SUSPENDED_VERIFICATIONEVENTLIFECYCLESTATE + case "invalidated": + result = INVALIDATED_VERIFICATIONEVENTLIFECYCLESTATE + case "issued": + result = ISSUED_VERIFICATIONEVENTLIFECYCLESTATE + case "blocked": + result = BLOCKED_VERIFICATIONEVENTLIFECYCLESTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_VERIFICATIONEVENTLIFECYCLESTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeVerificationEventLifecycleState(values []VerificationEventLifecycleState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i VerificationEventLifecycleState) isMultiValue() bool { + return false +} diff --git a/models/verification_event_override.go b/models/verification_event_override.go new file mode 100644 index 00000000000..2849e6c9c7e --- /dev/null +++ b/models/verification_event_override.go @@ -0,0 +1,273 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// VerificationEventOverride details of an administrative or programmatic override applied to a verification event. +type VerificationEventOverride struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewVerificationEventOverride instantiates a new VerificationEventOverride and sets the default values. +func NewVerificationEventOverride() *VerificationEventOverride { + m := &VerificationEventOverride{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateVerificationEventOverrideFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVerificationEventOverrideFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVerificationEventOverride(), nil +} + +// GetActorId gets the actorId property value. The object ID of the actor who applied the override. Set by the service from the caller's identity. Read-only. +// returns a *string when successful +func (m *VerificationEventOverride) GetActorId() *string { + val, err := m.GetBackingStore().Get("actorId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetActorType gets the actorType property value. The actorType property +// returns a *VerificationActorType when successful +func (m *VerificationEventOverride) GetActorType() *VerificationActorType { + val, err := m.GetBackingStore().Get("actorType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*VerificationActorType) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *VerificationEventOverride) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *VerificationEventOverride) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *VerificationEventOverride) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["actorId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actorType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseVerificationActorType) + if err != nil { + return err + } + if val != nil { + m.SetActorType(val.(*VerificationActorType)) + } + return nil + } + res["@odata.type"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOdataType(val) + } + return nil + } + res["overriddenDateTime"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetOverriddenDateTime(val) + } + return nil + } + res["reason"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} + +// GetOdataType gets the @odata.type property value. The OdataType property +// returns a *string when successful +func (m *VerificationEventOverride) GetOdataType() *string { + val, err := m.GetBackingStore().Get("odataType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetOverriddenDateTime gets the overriddenDateTime property value. The date and time when the override was applied. Set by the service. Read-only. +// returns a *Time when successful +func (m *VerificationEventOverride) GetOverriddenDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time { + val, err := m.GetBackingStore().Get("overriddenDateTime") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + } + return nil +} + +// GetReason gets the reason property value. The explanation for the override, such as In-person identity proofing confirmed by help desk. Maximum 500 characters. +// returns a *string when successful +func (m *VerificationEventOverride) GetReason() *string { + val, err := m.GetBackingStore().Get("reason") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *VerificationEventOverride) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + if m.GetActorType() != nil { + cast := (*m.GetActorType()).String() + err := writer.WriteStringValue("actorType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("@odata.type", m.GetOdataType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetActorId sets the actorId property value. The object ID of the actor who applied the override. Set by the service from the caller's identity. Read-only. +func (m *VerificationEventOverride) SetActorId(value *string) { + err := m.GetBackingStore().Set("actorId", value) + if err != nil { + panic(err) + } +} + +// SetActorType sets the actorType property value. The actorType property +func (m *VerificationEventOverride) SetActorType(value *VerificationActorType) { + err := m.GetBackingStore().Set("actorType", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *VerificationEventOverride) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *VerificationEventOverride) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetOdataType sets the @odata.type property value. The OdataType property +func (m *VerificationEventOverride) SetOdataType(value *string) { + err := m.GetBackingStore().Set("odataType", value) + if err != nil { + panic(err) + } +} + +// SetOverriddenDateTime sets the overriddenDateTime property value. The date and time when the override was applied. Set by the service. Read-only. +func (m *VerificationEventOverride) SetOverriddenDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + err := m.GetBackingStore().Set("overriddenDateTime", value) + if err != nil { + panic(err) + } +} + +// SetReason sets the reason property value. The explanation for the override, such as In-person identity proofing confirmed by help desk. Maximum 500 characters. +func (m *VerificationEventOverride) SetReason(value *string) { + err := m.GetBackingStore().Set("reason", value) + if err != nil { + panic(err) + } +} + +type VerificationEventOverrideable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId() *string + GetActorType() *VerificationActorType + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetOdataType() *string + GetOverriddenDateTime() *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + GetReason() *string + SetActorId(value *string) + SetActorType(value *VerificationActorType) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetOdataType(value *string) + SetOverriddenDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetReason(value *string) +} diff --git a/models/verification_lifecycle_source.go b/models/verification_lifecycle_source.go new file mode 100644 index 00000000000..4700cb58e63 --- /dev/null +++ b/models/verification_lifecycle_source.go @@ -0,0 +1,46 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type VerificationLifecycleSource int + +const ( + ENTRA_VERIFICATIONLIFECYCLESOURCE VerificationLifecycleSource = iota + ADMINOVERRIDE_VERIFICATIONLIFECYCLESOURCE + APIOVERRIDE_VERIFICATIONLIFECYCLESOURCE + UNKNOWNFUTUREVALUE_VERIFICATIONLIFECYCLESOURCE +) + +func (i VerificationLifecycleSource) String() string { + return []string{"entra", "adminOverride", "apiOverride", "unknownFutureValue"}[i] +} + +func ParseVerificationLifecycleSource(v string) (any, error) { + result := ENTRA_VERIFICATIONLIFECYCLESOURCE + switch v { + case "entra": + result = ENTRA_VERIFICATIONLIFECYCLESOURCE + case "adminOverride": + result = ADMINOVERRIDE_VERIFICATIONLIFECYCLESOURCE + case "apiOverride": + result = APIOVERRIDE_VERIFICATIONLIFECYCLESOURCE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_VERIFICATIONLIFECYCLESOURCE + default: + return nil, nil + } + return &result, nil +} + +func SerializeVerificationLifecycleSource(values []VerificationLifecycleSource) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i VerificationLifecycleSource) isMultiValue() bool { + return false +} diff --git a/models/verification_state.go b/models/verification_state.go new file mode 100644 index 00000000000..61e98c11eb2 --- /dev/null +++ b/models/verification_state.go @@ -0,0 +1,55 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package models + +type VerificationState int + +const ( + UNVERIFIED_VERIFICATIONSTATE VerificationState = iota + VERIFIED_VERIFICATIONSTATE + REVOKED_VERIFICATIONSTATE + SUSPENDED_VERIFICATIONSTATE + ISSUED_VERIFICATIONSTATE + BLOCKED_VERIFICATIONSTATE + UNKNOWNFUTUREVALUE_VERIFICATIONSTATE +) + +func (i VerificationState) String() string { + return []string{"unverified", "verified", "revoked", "suspended", "issued", "blocked", "unknownFutureValue"}[i] +} + +func ParseVerificationState(v string) (any, error) { + result := UNVERIFIED_VERIFICATIONSTATE + switch v { + case "unverified": + result = UNVERIFIED_VERIFICATIONSTATE + case "verified": + result = VERIFIED_VERIFICATIONSTATE + case "revoked": + result = REVOKED_VERIFICATIONSTATE + case "suspended": + result = SUSPENDED_VERIFICATIONSTATE + case "issued": + result = ISSUED_VERIFICATIONSTATE + case "blocked": + result = BLOCKED_VERIFICATIONSTATE + case "unknownFutureValue": + result = UNKNOWNFUTUREVALUE_VERIFICATIONSTATE + default: + return nil, nil + } + return &result, nil +} + +func SerializeVerificationState(values []VerificationState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} + +func (i VerificationState) isMultiValue() bool { + return false +} diff --git a/networkaccess/820f175faf340d80b44c08719ed5fee092b33e542bf2f175c671b41ee6800494.go b/networkaccess/157ab82312d1b8f78efe5f3cee4a8a1b053ed492c14b45f88daf7f11bd96be69.go similarity index 52% rename from networkaccess/820f175faf340d80b44c08719ed5fee092b33e542bf2f175c671b41ee6800494.go rename to networkaccess/157ab82312d1b8f78efe5f3cee4a8a1b053ed492c14b45f88daf7f11bd96be69.go index 11cf74c6190..aae92265297 100644 --- a/networkaccess/820f175faf340d80b44c08719ed5fee092b33e542bf2f175c671b41ee6800494.go +++ b/networkaccess/157ab82312d1b8f78efe5f3cee4a8a1b053ed492c14b45f88daf7f11bd96be69.go @@ -9,27 +9,27 @@ import ( i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/networkaccess" ) -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse struct { +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse struct { ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse } -// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse and sets the default values. -func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse() *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse { - m := &ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse{ +// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse and sets the default values. +func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse() *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse { + m := &ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse{ BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), } return m } -// CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value // returns a Parsable when successful -func CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse(), nil +func CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse(), nil } // GetFieldDeserializers the deserialization information for the current model // returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { val, err := n.GetCollectionOfObjectValues(i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2.CreateDiscoveredApplicationSegmentReportFromDiscriminatorValue) @@ -52,7 +52,7 @@ func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReport // GetValue gets the value property value. The value property // returns a []DiscoveredApplicationSegmentReportable when successful -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse) GetValue() []i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2.DiscoveredApplicationSegmentReportable { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse) GetValue() []i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2.DiscoveredApplicationSegmentReportable { val, err := m.GetBackingStore().Get("value") if err != nil { panic(err) @@ -64,7 +64,7 @@ func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReport } // Serialize serializes information the current object -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { err := m.BaseCollectionPaginationCountResponse.Serialize(writer) if err != nil { return err @@ -85,14 +85,14 @@ func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReport } // SetValue sets the value property value. The value property -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse) SetValue(value []i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2.DiscoveredApplicationSegmentReportable) { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse) SetValue(value []i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2.DiscoveredApplicationSegmentReportable) { err := m.GetBackingStore().Set("value", value) if err != nil { panic(err) } } -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable interface { +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable interface { ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable GetValue() []i43e723cc778f0f3f3a05d36b9df74faa56771e9360d8ed793c50bdaacec8d5d2.DiscoveredApplicationSegmentReportable diff --git a/networkaccess/925962068cc334654a3fa8805e61c23afe2262827bc492564e389c87d9f2a527.go b/networkaccess/749a4c94fd0438dcd9ce2255aec0c8d193c4091c173037f7ab626491edfe0905.go similarity index 54% rename from networkaccess/925962068cc334654a3fa8805e61c23afe2262827bc492564e389c87d9f2a527.go rename to networkaccess/749a4c94fd0438dcd9ce2255aec0c8d193c4091c173037f7ab626491edfe0905.go index 982f15b7891..9c917314e24 100644 --- a/networkaccess/925962068cc334654a3fa8805e61c23afe2262827bc492564e389c87d9f2a527.go +++ b/networkaccess/749a4c94fd0438dcd9ce2255aec0c8d193c4091c173037f7ab626491edfe0905.go @@ -10,19 +10,17 @@ import ( i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" ) -// ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder provides operations to call the getDiscoveredApplicationSegmentReport method. -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder struct { +// ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder provides operations to call the getDiscoveredApplicationSegmentReport method. +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetQueryParameters returns a collection of discovered application segments based on aggregated traffic logs for a given period. -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetQueryParameters struct { +// ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetQueryParameters returns a collection of discovered application segments based on aggregated traffic logs for a given period. +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" // Filter items by property values Filter *string "uriparametername:\"%24filter\"" - // Usage: groupingId='@groupingId' - GroupingId *string "uriparametername:\"groupingId\"" // Search items by search phrases Search *string "uriparametername:\"%24search\"" // Skip the first n items @@ -33,20 +31,20 @@ type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWith UserId *string "uriparametername:\"userId\"" } -// ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetRequestConfiguration struct { +// ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetRequestConfiguration struct { // Request headers Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders // Request options Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption // Request query parameters - QueryParameters *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetQueryParameters + QueryParameters *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetQueryParameters } -// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderInternal instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder and sets the default values. -func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, endDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, startDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder { - m := &ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networkAccess/reports/microsoft.graph.networkaccess.getDiscoveredApplicationSegmentReport(startDateTime={startDateTime},endDateTime={endDateTime},userId='@userId',groupingId='@groupingId'){?%24count,%24filter,%24search,%24skip,%24top,groupingId*,userId*}", pathParameters), +// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderInternal instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder and sets the default values. +func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, endDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, startDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder { + m := &ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networkAccess/reports/microsoft.graph.networkaccess.getDiscoveredApplicationSegmentReport(startDateTime={startDateTime},endDateTime={endDateTime},userId='@userId'){?%24count,%24filter,%24search,%24skip,%24top,userId*}", pathParameters), } if endDateTime != nil { m.BaseRequestBuilder.PathParameters["endDateTime"] = (*endDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) @@ -57,21 +55,21 @@ func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportW return m } -// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder and sets the default values. -func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder { +// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder and sets the default values. +func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder { urlParams := make(map[string]string) urlParams["request-raw-url"] = rawUrl - return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderInternal(urlParams, requestAdapter, nil, nil) + return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderInternal(urlParams, requestAdapter, nil, nil) } // Get returns a collection of discovered application segments based on aggregated traffic logs for a given period. -// Deprecated: This method is obsolete. Use GetAsGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse instead. -// returns a ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseable when successful +// Deprecated: This method is obsolete. Use GetAsGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse instead. +// returns a ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseable 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/networkaccess-reports-getdiscoveredapplicationsegmentreport?view=graph-rest-beta -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder) Get(ctx context.Context, requestConfiguration *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetRequestConfiguration) (ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseable, error) { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder) Get(ctx context.Context, requestConfiguration *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetRequestConfiguration) (ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { return nil, err @@ -79,23 +77,23 @@ func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReport errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseFromDiscriminatorValue, errorMapping) + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseFromDiscriminatorValue, errorMapping) if err != nil { return nil, err } if res == nil { return nil, nil } - return res.(ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseable), nil + return res.(ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseable), nil } -// GetAsGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse returns a collection of discovered application segments based on aggregated traffic logs for a given period. -// returns a ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable when successful +// GetAsGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse returns a collection of discovered application segments based on aggregated traffic logs for a given period. +// returns a ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable 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/networkaccess-reports-getdiscoveredapplicationsegmentreport?view=graph-rest-beta -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder) GetAsGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse(ctx context.Context, requestConfiguration *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetRequestConfiguration) (ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable, error) { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder) GetAsGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse(ctx context.Context, requestConfiguration *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetRequestConfiguration) (ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { return nil, err @@ -103,19 +101,19 @@ func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReport errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, } - res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseFromDiscriminatorValue, errorMapping) + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseFromDiscriminatorValue, errorMapping) if err != nil { return nil, err } if res == nil { return nil, nil } - return res.(ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable), nil + return res.(ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable), nil } // ToGetRequestInformation returns a collection of discovered application segments based on aggregated traffic logs for a given period. // returns a *RequestInformation when successful -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) if requestConfiguration != nil { if requestConfiguration.QueryParameters != nil { @@ -129,7 +127,7 @@ func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReport } // WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. -// returns a *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder when successful -func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder) WithUrl(rawUrl string) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder { - return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +// returns a *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder when successful +func (m *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder) WithUrl(rawUrl string) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder { + return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) } diff --git a/networkaccess/bd7acefba2b2253c15b534d8fbabf8a9e28533dfbe245637e5522fdd5b9d70a2.go b/networkaccess/bd7acefba2b2253c15b534d8fbabf8a9e28533dfbe245637e5522fdd5b9d70a2.go deleted file mode 100644 index 6f54cfe8c9c..00000000000 --- a/networkaccess/bd7acefba2b2253c15b534d8fbabf8a9e28533dfbe245637e5522fdd5b9d70a2.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by Microsoft Kiota - DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package networkaccess - -import ( - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" -) - -// Deprecated: This class is obsolete. Use ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable instead. -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse struct { - ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse -} - -// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse and sets the default values. -func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse() *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse { - m := &ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse{ - ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse: *NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponse(), - } - return m -} - -// CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value -// returns a Parsable when successful -func CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponse(), nil -} - -// Deprecated: This class is obsolete. Use ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable instead. -type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdResponseable interface { - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdGetResponseable -} diff --git a/networkaccess/da793f9d4a2e14ca95b85422f9b036a71736601c075e6c6d5e67ae8bd600724b.go b/networkaccess/da793f9d4a2e14ca95b85422f9b036a71736601c075e6c6d5e67ae8bd600724b.go new file mode 100644 index 00000000000..5a9d6cfff84 --- /dev/null +++ b/networkaccess/da793f9d4a2e14ca95b85422f9b036a71736601c075e6c6d5e67ae8bd600724b.go @@ -0,0 +1,33 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package networkaccess + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable instead. +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse struct { + ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse +} + +// NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse instantiates a new ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse and sets the default values. +func NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse() *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse { + m := &ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse{ + ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse: *NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponse(), + } + return m +} + +// CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponse(), nil +} + +// Deprecated: This class is obsolete. Use ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable instead. +type ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGetResponseable +} diff --git a/networkaccess/reports_request_builder.go b/networkaccess/reports_request_builder.go index 657efbe4c29..cc01bada551 100644 --- a/networkaccess/reports_request_builder.go +++ b/networkaccess/reports_request_builder.go @@ -163,10 +163,10 @@ func (m *ReportsRequestBuilder) MicrosoftGraphNetworkaccessGetDeviceUsageSummary return NewReportsMicrosoftGraphNetworkaccessGetDeviceUsageSummaryWithStartDateTimeWithEndDateTimeWithActivityPivotDateTimeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, activityPivotDateTime, endDateTime, startDateTime) } -// MicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingId provides operations to call the getDiscoveredApplicationSegmentReport method. -// returns a *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder when successful -func (m *ReportsRequestBuilder) MicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingId(endDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, startDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilder { - return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdGroupingIdGroupingIdRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, endDateTime, startDateTime) +// MicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserId provides operations to call the getDiscoveredApplicationSegmentReport method. +// returns a *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder when successful +func (m *ReportsRequestBuilder) MicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserId(endDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, startDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilder { + return NewReportsMicrosoftGraphNetworkaccessGetDiscoveredApplicationSegmentReportWithStartDateTimeWithEndDateTimeuserIdUserIdRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, endDateTime, startDateTime) } // MicrosoftGraphNetworkaccessGetEnterpriseApplicationReportWithStartDateTimeWithEndDateTimeuserIdUserId provides operations to call the getEnterpriseApplicationReport method. diff --git a/organization/item_restore_request_builder.go b/organization/item_restore_request_builder.go index 5efffa00b07..afff91e25ac 100644 --- a/organization/item_restore_request_builder.go +++ b/organization/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/permissiongrants/item_restore_request_builder.go b/permissiongrants/item_restore_request_builder.go index 882872a9336..897496884a5 100644 --- a/permissiongrants/item_restore_request_builder.go +++ b/permissiongrants/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/planner_request_builder.go b/planner/planner_request_builder.go index 3f2746bc1e1..bc7b45917e7 100644 --- a/planner/planner_request_builder.go +++ b/planner/planner_request_builder.go @@ -92,12 +92,9 @@ func (m *PlannerRequestBuilder) Goals() *GoalsRequestBuilder { return NewGoalsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Patch update the properties of a planner object. +// Patch update planner // returns a Plannerable 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/planner-update?view=graph-rest-beta func (m *PlannerRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Plannerable, requestConfiguration *PlannerRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Plannerable, error) { requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) if err != nil { @@ -161,7 +158,7 @@ func (m *PlannerRequestBuilder) ToGetRequestInformation(ctx context.Context, req return requestInfo, nil } -// ToPatchRequestInformation update the properties of a planner object. +// ToPatchRequestInformation update planner // returns a *RequestInformation when successful func (m *PlannerRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Plannerable, requestConfiguration *PlannerRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_buckets_bucket_item_request_builder.go b/planner/plans_escaped_v2_item_buckets_bucket_item_request_builder.go index 560da692f8b..4ebf1f91960 100644 --- a/planner/plans_escaped_v2_item_buckets_bucket_item_request_builder.go +++ b/planner/plans_escaped_v2_item_buckets_bucket_item_request_builder.go @@ -23,7 +23,7 @@ type Plans_v2ItemBucketsBucketItemRequestBuilderDeleteRequestConfiguration struc Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// Plans_v2ItemBucketsBucketItemRequestBuilderGetQueryParameters the collection of buckets in the plan. Read-only. Nullable. +// Plans_v2ItemBucketsBucketItemRequestBuilderGetQueryParameters read the properties and relationships of bucket object. type Plans_v2ItemBucketsBucketItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -64,8 +64,11 @@ func NewPlans_v2ItemBucketsBucketItemRequestBuilder(rawUrl string, requestAdapte return NewPlans_v2ItemBucketsBucketItemRequestBuilderInternal(urlParams, requestAdapter) } -// Delete delete navigation property buckets for planner +// Delete delete a bucket object. // 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/plan-delete-buckets?view=graph-rest-beta func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *Plans_v2ItemBucketsBucketItemRequestBuilderDeleteRequestConfiguration) error { requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) if err != nil { @@ -81,9 +84,12 @@ func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) Delete(ctx context.Context return nil } -// Get the collection of buckets in the plan. Read-only. Nullable. +// Get read the properties and relationships of bucket object. // returns a Bucketable 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/bucket-get?view=graph-rest-beta func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemBucketsBucketItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { @@ -102,9 +108,12 @@ func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) Get(ctx context.Context, r return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable), nil } -// Patch update the navigation property buckets in planner +// Patch update the properties of a bucket object. // returns a Bucketable 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/bucket-update?view=graph-rest-beta func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, requestConfiguration *Plans_v2ItemBucketsBucketItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, error) { requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) if err != nil { @@ -123,7 +132,7 @@ func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) Patch(ctx context.Context, return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable), nil } -// ToDeleteRequestInformation delete navigation property buckets for planner +// ToDeleteRequestInformation delete a bucket object. // returns a *RequestInformation when successful func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemBucketsBucketItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -135,7 +144,7 @@ func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) ToDeleteRequestInformation return requestInfo, nil } -// ToGetRequestInformation the collection of buckets in the plan. Read-only. Nullable. +// ToGetRequestInformation read the properties and relationships of bucket object. // returns a *RequestInformation when successful func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemBucketsBucketItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -150,7 +159,7 @@ func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) ToGetRequestInformation(ct return requestInfo, nil } -// ToPatchRequestInformation update the navigation property buckets in planner +// ToPatchRequestInformation update the properties of a bucket object. // returns a *RequestInformation when successful func (m *Plans_v2ItemBucketsBucketItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, requestConfiguration *Plans_v2ItemBucketsBucketItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_buckets_request_builder.go b/planner/plans_escaped_v2_item_buckets_request_builder.go index 7aea70e41a1..8679a20d06e 100644 --- a/planner/plans_escaped_v2_item_buckets_request_builder.go +++ b/planner/plans_escaped_v2_item_buckets_request_builder.go @@ -15,7 +15,7 @@ type Plans_v2ItemBucketsRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Plans_v2ItemBucketsRequestBuilderGetQueryParameters the collection of buckets in the plan. Read-only. Nullable. +// Plans_v2ItemBucketsRequestBuilderGetQueryParameters get a list of the bucket objects and their properties. type Plans_v2ItemBucketsRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,9 +87,12 @@ func (m *Plans_v2ItemBucketsRequestBuilder) Count() *Plans_v2ItemBucketsCountReq return NewPlans_v2ItemBucketsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of buckets in the plan. Read-only. Nullable. +// Get get a list of the bucket objects and their properties. // returns a BucketCollectionResponseable 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/plan-list-buckets?view=graph-rest-beta func (m *Plans_v2ItemBucketsRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemBucketsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BucketCollectionResponseable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { @@ -108,9 +111,12 @@ func (m *Plans_v2ItemBucketsRequestBuilder) Get(ctx context.Context, requestConf return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BucketCollectionResponseable), nil } -// Post create new navigation property to buckets for planner +// Post create a new bucket object. // returns a Bucketable 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/plan-post-buckets?view=graph-rest-beta func (m *Plans_v2ItemBucketsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, requestConfiguration *Plans_v2ItemBucketsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, error) { requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration) if err != nil { @@ -129,7 +135,7 @@ func (m *Plans_v2ItemBucketsRequestBuilder) Post(ctx context.Context, body ie233 return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable), nil } -// ToGetRequestInformation the collection of buckets in the plan. Read-only. Nullable. +// ToGetRequestInformation get a list of the bucket objects and their properties. // returns a *RequestInformation when successful func (m *Plans_v2ItemBucketsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemBucketsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -144,7 +150,7 @@ func (m *Plans_v2ItemBucketsRequestBuilder) ToGetRequestInformation(ctx context. return requestInfo, nil } -// ToPostRequestInformation create new navigation property to buckets for planner +// ToPostRequestInformation create a new bucket object. // returns a *RequestInformation when successful func (m *Plans_v2ItemBucketsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Bucketable, requestConfiguration *Plans_v2ItemBucketsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_contexts_plan_context_link_item_request_builder.go b/planner/plans_escaped_v2_item_contexts_plan_context_link_item_request_builder.go index f093454fc6c..bae1f804acb 100644 --- a/planner/plans_escaped_v2_item_contexts_plan_context_link_item_request_builder.go +++ b/planner/plans_escaped_v2_item_contexts_plan_context_link_item_request_builder.go @@ -23,7 +23,7 @@ type Plans_v2ItemContextsPlanContextLinkItemRequestBuilderDeleteRequestConfigura Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// Plans_v2ItemContextsPlanContextLinkItemRequestBuilderGetQueryParameters the collection of context links describing where the plan is surfaced. Read-only. Nullable. +// Plans_v2ItemContextsPlanContextLinkItemRequestBuilderGetQueryParameters context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. type Plans_v2ItemContextsPlanContextLinkItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -81,7 +81,7 @@ func (m *Plans_v2ItemContextsPlanContextLinkItemRequestBuilder) Delete(ctx conte return nil } -// Get the collection of context links describing where the plan is surfaced. Read-only. Nullable. +// Get context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a PlanContextLinkable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Plans_v2ItemContextsPlanContextLinkItemRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemContextsPlanContextLinkItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanContextLinkable, error) { @@ -135,7 +135,7 @@ func (m *Plans_v2ItemContextsPlanContextLinkItemRequestBuilder) ToDeleteRequestI return requestInfo, nil } -// ToGetRequestInformation the collection of context links describing where the plan is surfaced. Read-only. Nullable. +// ToGetRequestInformation context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Plans_v2ItemContextsPlanContextLinkItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemContextsPlanContextLinkItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_contexts_request_builder.go b/planner/plans_escaped_v2_item_contexts_request_builder.go index c90a07b4d72..cf24aa3466a 100644 --- a/planner/plans_escaped_v2_item_contexts_request_builder.go +++ b/planner/plans_escaped_v2_item_contexts_request_builder.go @@ -15,7 +15,7 @@ type Plans_v2ItemContextsRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Plans_v2ItemContextsRequestBuilderGetQueryParameters the collection of context links describing where the plan is surfaced. Read-only. Nullable. +// Plans_v2ItemContextsRequestBuilderGetQueryParameters context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. type Plans_v2ItemContextsRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,7 +87,7 @@ func (m *Plans_v2ItemContextsRequestBuilder) Count() *Plans_v2ItemContextsCountR return NewPlans_v2ItemContextsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of context links describing where the plan is surfaced. Read-only. Nullable. +// Get context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a PlanContextLinkCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Plans_v2ItemContextsRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemContextsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanContextLinkCollectionResponseable, error) { @@ -129,7 +129,7 @@ func (m *Plans_v2ItemContextsRequestBuilder) Post(ctx context.Context, body ie23 return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanContextLinkable), nil } -// ToGetRequestInformation the collection of context links describing where the plan is surfaced. Read-only. Nullable. +// ToGetRequestInformation context links describing where the plan is surfaced. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Plans_v2ItemContextsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemContextsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_links_content_link_item_request_builder.go b/planner/plans_escaped_v2_item_links_content_link_item_request_builder.go index 4b709b7dd2c..c581a0e250d 100644 --- a/planner/plans_escaped_v2_item_links_content_link_item_request_builder.go +++ b/planner/plans_escaped_v2_item_links_content_link_item_request_builder.go @@ -23,7 +23,7 @@ type Plans_v2ItemLinksContentLinkItemRequestBuilderDeleteRequestConfiguration st Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// Plans_v2ItemLinksContentLinkItemRequestBuilderGetQueryParameters the collection of content links attached to the plan. Read-only. Nullable. +// Plans_v2ItemLinksContentLinkItemRequestBuilderGetQueryParameters content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. type Plans_v2ItemLinksContentLinkItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -81,7 +81,7 @@ func (m *Plans_v2ItemLinksContentLinkItemRequestBuilder) Delete(ctx context.Cont return nil } -// Get the collection of content links attached to the plan. Read-only. Nullable. +// Get content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a ContentLinkable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Plans_v2ItemLinksContentLinkItemRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemLinksContentLinkItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ContentLinkable, error) { @@ -135,7 +135,7 @@ func (m *Plans_v2ItemLinksContentLinkItemRequestBuilder) ToDeleteRequestInformat return requestInfo, nil } -// ToGetRequestInformation the collection of content links attached to the plan. Read-only. Nullable. +// ToGetRequestInformation content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Plans_v2ItemLinksContentLinkItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemLinksContentLinkItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_links_request_builder.go b/planner/plans_escaped_v2_item_links_request_builder.go index edc70ca0022..8ae083f364c 100644 --- a/planner/plans_escaped_v2_item_links_request_builder.go +++ b/planner/plans_escaped_v2_item_links_request_builder.go @@ -15,7 +15,7 @@ type Plans_v2ItemLinksRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Plans_v2ItemLinksRequestBuilderGetQueryParameters the collection of content links attached to the plan. Read-only. Nullable. +// Plans_v2ItemLinksRequestBuilderGetQueryParameters content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. type Plans_v2ItemLinksRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,7 +87,7 @@ func (m *Plans_v2ItemLinksRequestBuilder) Count() *Plans_v2ItemLinksCountRequest return NewPlans_v2ItemLinksCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of content links attached to the plan. Read-only. Nullable. +// Get content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a ContentLinkCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Plans_v2ItemLinksRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemLinksRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ContentLinkCollectionResponseable, error) { @@ -129,7 +129,7 @@ func (m *Plans_v2ItemLinksRequestBuilder) Post(ctx context.Context, body ie233ee return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ContentLinkable), nil } -// ToGetRequestInformation the collection of content links attached to the plan. Read-only. Nullable. +// ToGetRequestInformation content links attached to the plan. Can be supplied when creating a plan by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Plans_v2ItemLinksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemLinksRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/plans_escaped_v2_item_tasks_request_builder.go b/planner/plans_escaped_v2_item_tasks_request_builder.go index 6e9bc8ed09e..ef490805650 100644 --- a/planner/plans_escaped_v2_item_tasks_request_builder.go +++ b/planner/plans_escaped_v2_item_tasks_request_builder.go @@ -15,7 +15,7 @@ type Plans_v2ItemTasksRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Plans_v2ItemTasksRequestBuilderGetQueryParameters the collection of tasks in the plan. Read-only. Nullable. +// Plans_v2ItemTasksRequestBuilderGetQueryParameters get a list of the task objects and their properties. type Plans_v2ItemTasksRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,9 +79,12 @@ func (m *Plans_v2ItemTasksRequestBuilder) Count() *Plans_v2ItemTasksCountRequest return NewPlans_v2ItemTasksCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of tasks in the plan. Read-only. Nullable. +// Get get a list of the task objects and their properties. // returns a TaskCollectionResponseable 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/plan-list-tasks?view=graph-rest-beta func (m *Plans_v2ItemTasksRequestBuilder) Get(ctx context.Context, requestConfiguration *Plans_v2ItemTasksRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TaskCollectionResponseable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { @@ -100,7 +103,7 @@ func (m *Plans_v2ItemTasksRequestBuilder) Get(ctx context.Context, requestConfig return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TaskCollectionResponseable), nil } -// ToGetRequestInformation the collection of tasks in the plan. Read-only. Nullable. +// ToGetRequestInformation get a list of the task objects and their properties. // returns a *RequestInformation when successful func (m *Plans_v2ItemTasksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Plans_v2ItemTasksRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_checklist_checklist_item_v4_item_request_builder.go b/planner/tasks_escaped_v2_item_checklist_checklist_item_v4_item_request_builder.go index d0cf515065c..9442da02460 100644 --- a/planner/tasks_escaped_v2_item_checklist_checklist_item_v4_item_request_builder.go +++ b/planner/tasks_escaped_v2_item_checklist_checklist_item_v4_item_request_builder.go @@ -23,7 +23,7 @@ type Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilderDeleteRequestConfigur Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilderGetQueryParameters the collection of checklist items on the task. Read-only. Nullable. +// Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilderGetQueryParameters checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. type Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -81,7 +81,7 @@ func (m *Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilder) Delete(ctx cont return nil } -// Get the collection of checklist items on the task. Read-only. Nullable. +// Get checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a ChecklistItemV4able when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ChecklistItemV4able, error) { @@ -135,7 +135,7 @@ func (m *Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilder) ToDeleteRequest return requestInfo, nil } -// ToGetRequestInformation the collection of checklist items on the task. Read-only. Nullable. +// ToGetRequestInformation checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemChecklistChecklistItemV4ItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_checklist_request_builder.go b/planner/tasks_escaped_v2_item_checklist_request_builder.go index 1cd6460a0d9..a53bb5aa520 100644 --- a/planner/tasks_escaped_v2_item_checklist_request_builder.go +++ b/planner/tasks_escaped_v2_item_checklist_request_builder.go @@ -15,7 +15,7 @@ type Tasks_v2ItemChecklistRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Tasks_v2ItemChecklistRequestBuilderGetQueryParameters the collection of checklist items on the task. Read-only. Nullable. +// Tasks_v2ItemChecklistRequestBuilderGetQueryParameters checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. type Tasks_v2ItemChecklistRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,7 +87,7 @@ func (m *Tasks_v2ItemChecklistRequestBuilder) Count() *Tasks_v2ItemChecklistCoun return NewTasks_v2ItemChecklistCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of checklist items on the task. Read-only. Nullable. +// Get checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a ChecklistItemV4CollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Tasks_v2ItemChecklistRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemChecklistRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ChecklistItemV4CollectionResponseable, error) { @@ -129,7 +129,7 @@ func (m *Tasks_v2ItemChecklistRequestBuilder) Post(ctx context.Context, body ie2 return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ChecklistItemV4able), nil } -// ToGetRequestInformation the collection of checklist items on the task. Read-only. Nullable. +// ToGetRequestInformation checklist items on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Tasks_v2ItemChecklistRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemChecklistRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_links_content_link_item_request_builder.go b/planner/tasks_escaped_v2_item_links_content_link_item_request_builder.go index 7be1b5c6155..2fc2e8e7d85 100644 --- a/planner/tasks_escaped_v2_item_links_content_link_item_request_builder.go +++ b/planner/tasks_escaped_v2_item_links_content_link_item_request_builder.go @@ -23,7 +23,7 @@ type Tasks_v2ItemLinksContentLinkItemRequestBuilderDeleteRequestConfiguration st Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// Tasks_v2ItemLinksContentLinkItemRequestBuilderGetQueryParameters the collection of content links attached to the task. Read-only. Nullable. +// Tasks_v2ItemLinksContentLinkItemRequestBuilderGetQueryParameters content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. type Tasks_v2ItemLinksContentLinkItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -81,7 +81,7 @@ func (m *Tasks_v2ItemLinksContentLinkItemRequestBuilder) Delete(ctx context.Cont return nil } -// Get the collection of content links attached to the task. Read-only. Nullable. +// Get content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a ContentLinkable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Tasks_v2ItemLinksContentLinkItemRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemLinksContentLinkItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ContentLinkable, error) { @@ -135,7 +135,7 @@ func (m *Tasks_v2ItemLinksContentLinkItemRequestBuilder) ToDeleteRequestInformat return requestInfo, nil } -// ToGetRequestInformation the collection of content links attached to the task. Read-only. Nullable. +// ToGetRequestInformation content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Tasks_v2ItemLinksContentLinkItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemLinksContentLinkItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_links_request_builder.go b/planner/tasks_escaped_v2_item_links_request_builder.go index 01cd0252f16..e9a94238a18 100644 --- a/planner/tasks_escaped_v2_item_links_request_builder.go +++ b/planner/tasks_escaped_v2_item_links_request_builder.go @@ -15,7 +15,7 @@ type Tasks_v2ItemLinksRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Tasks_v2ItemLinksRequestBuilderGetQueryParameters the collection of content links attached to the task. Read-only. Nullable. +// Tasks_v2ItemLinksRequestBuilderGetQueryParameters content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. type Tasks_v2ItemLinksRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,7 +87,7 @@ func (m *Tasks_v2ItemLinksRequestBuilder) Count() *Tasks_v2ItemLinksCountRequest return NewTasks_v2ItemLinksCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of content links attached to the task. Read-only. Nullable. +// Get content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a ContentLinkCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Tasks_v2ItemLinksRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemLinksRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ContentLinkCollectionResponseable, error) { @@ -129,7 +129,7 @@ func (m *Tasks_v2ItemLinksRequestBuilder) Post(ctx context.Context, body ie233ee return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ContentLinkable), nil } -// ToGetRequestInformation the collection of content links attached to the task. Read-only. Nullable. +// ToGetRequestInformation content links attached to the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Tasks_v2ItemLinksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemLinksRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_messages_request_builder.go b/planner/tasks_escaped_v2_item_messages_request_builder.go index 845ef841955..00c7f77ed91 100644 --- a/planner/tasks_escaped_v2_item_messages_request_builder.go +++ b/planner/tasks_escaped_v2_item_messages_request_builder.go @@ -15,7 +15,7 @@ type Tasks_v2ItemMessagesRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Tasks_v2ItemMessagesRequestBuilderGetQueryParameters the collection of chat messages associated with the task. Read-only. Nullable. +// Tasks_v2ItemMessagesRequestBuilderGetQueryParameters get a list of the plannerChatMessage objects associated with the task. type Tasks_v2ItemMessagesRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,9 +87,12 @@ func (m *Tasks_v2ItemMessagesRequestBuilder) Count() *Tasks_v2ItemMessagesCountR return NewTasks_v2ItemMessagesCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of chat messages associated with the task. Read-only. Nullable. +// Get get a list of the plannerChatMessage objects associated with the task. // returns a PlannerChatMessageCollectionResponseable 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/task-list-messages?view=graph-rest-beta func (m *Tasks_v2ItemMessagesRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemMessagesRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlannerChatMessageCollectionResponseable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { @@ -129,7 +132,7 @@ func (m *Tasks_v2ItemMessagesRequestBuilder) Post(ctx context.Context, body ie23 return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlannerChatMessageable), nil } -// ToGetRequestInformation the collection of chat messages associated with the task. Read-only. Nullable. +// ToGetRequestInformation get a list of the plannerChatMessage objects associated with the task. // returns a *RequestInformation when successful func (m *Tasks_v2ItemMessagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemMessagesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_user_assignments_request_builder.go b/planner/tasks_escaped_v2_item_user_assignments_request_builder.go index 682c28aea26..8db1702f24d 100644 --- a/planner/tasks_escaped_v2_item_user_assignments_request_builder.go +++ b/planner/tasks_escaped_v2_item_user_assignments_request_builder.go @@ -15,7 +15,7 @@ type Tasks_v2ItemUserAssignmentsRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// Tasks_v2ItemUserAssignmentsRequestBuilderGetQueryParameters the collection of user assignments on the task. Read-only. Nullable. +// Tasks_v2ItemUserAssignmentsRequestBuilderGetQueryParameters user assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. type Tasks_v2ItemUserAssignmentsRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,7 +87,7 @@ func (m *Tasks_v2ItemUserAssignmentsRequestBuilder) Count() *Tasks_v2ItemUserAss return NewTasks_v2ItemUserAssignmentsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the collection of user assignments on the task. Read-only. Nullable. +// Get user assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a UserAssignmentCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Tasks_v2ItemUserAssignmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemUserAssignmentsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.UserAssignmentCollectionResponseable, error) { @@ -129,7 +129,7 @@ func (m *Tasks_v2ItemUserAssignmentsRequestBuilder) Post(ctx context.Context, bo return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.UserAssignmentable), nil } -// ToGetRequestInformation the collection of user assignments on the task. Read-only. Nullable. +// ToGetRequestInformation user assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Tasks_v2ItemUserAssignmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemUserAssignmentsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_item_user_assignments_user_assignment_item_request_builder.go b/planner/tasks_escaped_v2_item_user_assignments_user_assignment_item_request_builder.go index 5feb2f5dc8b..b99cb6a664e 100644 --- a/planner/tasks_escaped_v2_item_user_assignments_user_assignment_item_request_builder.go +++ b/planner/tasks_escaped_v2_item_user_assignments_user_assignment_item_request_builder.go @@ -23,7 +23,7 @@ type Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilderDeleteRequestCon Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilderGetQueryParameters the collection of user assignments on the task. Read-only. Nullable. +// Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilderGetQueryParameters user assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. type Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -81,7 +81,7 @@ func (m *Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilder) Delete(ctx return nil } -// Get the collection of user assignments on the task. Read-only. Nullable. +// Get user assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a UserAssignmentable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.UserAssignmentable, error) { @@ -135,7 +135,7 @@ func (m *Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilder) ToDeleteRe return requestInfo, nil } -// ToGetRequestInformation the collection of user assignments on the task. Read-only. Nullable. +// ToGetRequestInformation user assignments on the task. Can be supplied when creating a task by using a deep insert. Nullable. // returns a *RequestInformation when successful func (m *Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *Tasks_v2ItemUserAssignmentsUserAssignmentItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/planner/tasks_escaped_v2_request_builder.go b/planner/tasks_escaped_v2_request_builder.go index 6298020b6b6..b34ae194c4a 100644 --- a/planner/tasks_escaped_v2_request_builder.go +++ b/planner/tasks_escaped_v2_request_builder.go @@ -92,7 +92,7 @@ func (m *Tasks_v2RequestBuilder) Count() *Tasks_v2CountRequestBuilder { // 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/plan-list-tasks?view=graph-rest-beta +// [Find more info here]: https://learn.microsoft.com/graph/api/planner-list-tasks_v2?view=graph-rest-beta func (m *Tasks_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *Tasks_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TaskCollectionResponseable, error) { requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) if err != nil { @@ -116,7 +116,7 @@ func (m *Tasks_v2RequestBuilder) Get(ctx context.Context, requestConfiguration * // 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/plan-post-tasks?view=graph-rest-beta +// [Find more info here]: https://learn.microsoft.com/graph/api/planner-post-tasks_v2?view=graph-rest-beta func (m *Tasks_v2RequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Taskable, requestConfiguration *Tasks_v2RequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Taskable, error) { requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration) if err != nil { diff --git a/reports/3d9e058ecad6234ac3a3b261c3d1db6d53ab46e9cd7480279f88c3d0b864f29a.go b/reports/3d9e058ecad6234ac3a3b261c3d1db6d53ab46e9cd7480279f88c3d0b864f29a.go new file mode 100644 index 00000000000..4f4f93d3591 --- /dev/null +++ b/reports/3d9e058ecad6234ac3a3b261c3d1db6d53ab46e9cd7480279f88c3d0b864f29a.go @@ -0,0 +1,99 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse() *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse { + m := &ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse{ + BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateServiceActivityValueMetricFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ServiceActivityValueMetricable when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable + SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) +} diff --git a/reports/527f89546d9ac0e7b18ec73c222f3bcc4432801594aa3dc69babb5868390bdba.go b/reports/527f89546d9ac0e7b18ec73c222f3bcc4432801594aa3dc69babb5868390bdba.go new file mode 100644 index 00000000000..ad4ba55327d --- /dev/null +++ b/reports/527f89546d9ac0e7b18ec73c222f3bcc4432801594aa3dc69babb5868390bdba.go @@ -0,0 +1,99 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse() *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse { + m := &ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse{ + BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateServiceActivityValueMetricFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ServiceActivityValueMetricable when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable + SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) +} diff --git a/reports/58cdab6f224566fb9bb31cb5e7a5914d1603fd6f9084b4ced501360eedb9f291.go b/reports/58cdab6f224566fb9bb31cb5e7a5914d1603fd6f9084b4ced501360eedb9f291.go new file mode 100644 index 00000000000..6425cb60861 --- /dev/null +++ b/reports/58cdab6f224566fb9bb31cb5e7a5914d1603fd6f9084b4ced501360eedb9f291.go @@ -0,0 +1,133 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder provides operations to call the getMetricsForAgentIdAutonomousSignInFailure method. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters retrieve the number of failed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. This metric counts attempts for which authentication wasn't completed. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters struct { + // Usage: aggregationIntervalInMinutes=@aggregationIntervalInMinutes + AggregationIntervalInMinutes *int32 "uriparametername:\"aggregationIntervalInMinutes\"" + // Include count of items + Count *bool "uriparametername:\"%24count\"" + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" + // Skip the first n items + Skip *int32 "uriparametername:\"%24skip\"" + // Show only the first n items + Top *int32 "uriparametername:\"%24top\"" +} + +// ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + m := &ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/reports/serviceActivity/getMetricsForAgentIdAutonomousSignInFailure(inclusiveIntervalStartDateTime={inclusiveIntervalStartDateTime},exclusiveIntervalEndDateTime={exclusiveIntervalEndDateTime},aggregationIntervalInMinutes=@aggregationIntervalInMinutes){?%24count,%24filter,%24search,%24skip,%24top,aggregationIntervalInMinutes*}", pathParameters), + } + if exclusiveIntervalEndDateTime != nil { + m.BaseRequestBuilder.PathParameters["exclusiveIntervalEndDateTime"] = (*exclusiveIntervalEndDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + if inclusiveIntervalStartDateTime != nil { + m.BaseRequestBuilder.PathParameters["inclusiveIntervalStartDateTime"] = (*inclusiveIntervalStartDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + return m +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(urlParams, requestAdapter, nil, nil) +} + +// Get retrieve the number of failed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. This metric counts attempts for which authentication wasn't completed. +// Deprecated: This method is obsolete. Use GetAsGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instead. +// returns a ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable 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/serviceactivity-getmetricsforagentidautonomoussigninfailure?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) Get(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable), nil +} + +// GetAsGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse retrieve the number of failed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. This metric counts attempts for which authentication wasn't completed. +// returns a ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable 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/serviceactivity-getmetricsforagentidautonomoussigninfailure?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) GetAsGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable), nil +} + +// ToGetRequestInformation retrieve the number of failed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. This metric counts attempts for which authentication wasn't completed. +// returns a *RequestInformation when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) WithUrl(rawUrl string) *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/reports/65d7bcbf59562ee4fc9f40f3e72c8a4031e61ec690ee65f7e88ad79eb9305739.go b/reports/65d7bcbf59562ee4fc9f40f3e72c8a4031e61ec690ee65f7e88ad79eb9305739.go new file mode 100644 index 00000000000..2784fd2a520 --- /dev/null +++ b/reports/65d7bcbf59562ee4fc9f40f3e72c8a4031e61ec690ee65f7e88ad79eb9305739.go @@ -0,0 +1,133 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder provides operations to call the getMetricsForAgentIdInteractiveSignInSuccess method. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters retrieve the number of completed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent signs in on behalf of a human user with delegated permissions to perform an action for that user. These sign-ins are distinct from Agent ID autonomous sign-ins, in which agents sign in and act as themselves. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters struct { + // Usage: aggregationIntervalInMinutes=@aggregationIntervalInMinutes + AggregationIntervalInMinutes *int32 "uriparametername:\"aggregationIntervalInMinutes\"" + // Include count of items + Count *bool "uriparametername:\"%24count\"" + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" + // Skip the first n items + Skip *int32 "uriparametername:\"%24skip\"" + // Show only the first n items + Top *int32 "uriparametername:\"%24top\"" +} + +// ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + m := &ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/reports/serviceActivity/getMetricsForAgentIdInteractiveSignInSuccess(inclusiveIntervalStartDateTime={inclusiveIntervalStartDateTime},exclusiveIntervalEndDateTime={exclusiveIntervalEndDateTime},aggregationIntervalInMinutes=@aggregationIntervalInMinutes){?%24count,%24filter,%24search,%24skip,%24top,aggregationIntervalInMinutes*}", pathParameters), + } + if exclusiveIntervalEndDateTime != nil { + m.BaseRequestBuilder.PathParameters["exclusiveIntervalEndDateTime"] = (*exclusiveIntervalEndDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + if inclusiveIntervalStartDateTime != nil { + m.BaseRequestBuilder.PathParameters["inclusiveIntervalStartDateTime"] = (*inclusiveIntervalStartDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + return m +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(urlParams, requestAdapter, nil, nil) +} + +// Get retrieve the number of completed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent signs in on behalf of a human user with delegated permissions to perform an action for that user. These sign-ins are distinct from Agent ID autonomous sign-ins, in which agents sign in and act as themselves. +// Deprecated: This method is obsolete. Use GetAsGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instead. +// returns a ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable 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/serviceactivity-getmetricsforagentidinteractivesigninsuccess?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) Get(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable), nil +} + +// GetAsGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse retrieve the number of completed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent signs in on behalf of a human user with delegated permissions to perform an action for that user. These sign-ins are distinct from Agent ID autonomous sign-ins, in which agents sign in and act as themselves. +// returns a ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable 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/serviceactivity-getmetricsforagentidinteractivesigninsuccess?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) GetAsGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable), nil +} + +// ToGetRequestInformation retrieve the number of completed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent signs in on behalf of a human user with delegated permissions to perform an action for that user. These sign-ins are distinct from Agent ID autonomous sign-ins, in which agents sign in and act as themselves. +// returns a *RequestInformation when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) WithUrl(rawUrl string) *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/reports/66501c4520673b7dc4356c9ba5cc4ab01501216ea3f8a9117becc1aa15fa0c84.go b/reports/66501c4520673b7dc4356c9ba5cc4ab01501216ea3f8a9117becc1aa15fa0c84.go new file mode 100644 index 00000000000..5dc1a089ce2 --- /dev/null +++ b/reports/66501c4520673b7dc4356c9ba5cc4ab01501216ea3f8a9117becc1aa15fa0c84.go @@ -0,0 +1,33 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse struct { + ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse() *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse { + m := &ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse{ + ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse: *NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse(), nil +} + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable +} diff --git a/reports/95677e81c613a740c670cfbc3d9d217c6fa243ceff620122fad31dadaaae0ca1.go b/reports/95677e81c613a740c670cfbc3d9d217c6fa243ceff620122fad31dadaaae0ca1.go new file mode 100644 index 00000000000..c359cd01346 --- /dev/null +++ b/reports/95677e81c613a740c670cfbc3d9d217c6fa243ceff620122fad31dadaaae0ca1.go @@ -0,0 +1,33 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse struct { + ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse() *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse { + m := &ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse{ + ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse: *NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse(), nil +} + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable +} diff --git a/reports/9a8f5b882956f6ef56aa3e96301186ad5fe893b7f4461ae978e52f591f4c24f6.go b/reports/9a8f5b882956f6ef56aa3e96301186ad5fe893b7f4461ae978e52f591f4c24f6.go new file mode 100644 index 00000000000..542e693b080 --- /dev/null +++ b/reports/9a8f5b882956f6ef56aa3e96301186ad5fe893b7f4461ae978e52f591f4c24f6.go @@ -0,0 +1,133 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder provides operations to call the getMetricsForAgentIdInteractiveSignInFailure method. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters retrieve the number of failed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent attempts to sign in on behalf of a human user with delegated permissions to perform an action for that user. This metric counts attempts for which authentication wasn't completed. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters struct { + // Usage: aggregationIntervalInMinutes=@aggregationIntervalInMinutes + AggregationIntervalInMinutes *int32 "uriparametername:\"aggregationIntervalInMinutes\"" + // Include count of items + Count *bool "uriparametername:\"%24count\"" + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" + // Skip the first n items + Skip *int32 "uriparametername:\"%24skip\"" + // Show only the first n items + Top *int32 "uriparametername:\"%24top\"" +} + +// ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + m := &ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/reports/serviceActivity/getMetricsForAgentIdInteractiveSignInFailure(inclusiveIntervalStartDateTime={inclusiveIntervalStartDateTime},exclusiveIntervalEndDateTime={exclusiveIntervalEndDateTime},aggregationIntervalInMinutes=@aggregationIntervalInMinutes){?%24count,%24filter,%24search,%24skip,%24top,aggregationIntervalInMinutes*}", pathParameters), + } + if exclusiveIntervalEndDateTime != nil { + m.BaseRequestBuilder.PathParameters["exclusiveIntervalEndDateTime"] = (*exclusiveIntervalEndDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + if inclusiveIntervalStartDateTime != nil { + m.BaseRequestBuilder.PathParameters["inclusiveIntervalStartDateTime"] = (*inclusiveIntervalStartDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + return m +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(urlParams, requestAdapter, nil, nil) +} + +// Get retrieve the number of failed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent attempts to sign in on behalf of a human user with delegated permissions to perform an action for that user. This metric counts attempts for which authentication wasn't completed. +// Deprecated: This method is obsolete. Use GetAsGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instead. +// returns a ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable 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/serviceactivity-getmetricsforagentidinteractivesigninfailure?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) Get(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable), nil +} + +// GetAsGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse retrieve the number of failed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent attempts to sign in on behalf of a human user with delegated permissions to perform an action for that user. This metric counts attempts for which authentication wasn't completed. +// returns a ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable 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/serviceactivity-getmetricsforagentidinteractivesigninfailure?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) GetAsGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable), nil +} + +// ToGetRequestInformation retrieve the number of failed interactive sign-ins by Agent IDs during a specified time period. In Agent ID interactive sign-ins, the agent attempts to sign in on behalf of a human user with delegated permissions to perform an action for that user. This metric counts attempts for which authentication wasn't completed. +// returns a *RequestInformation when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) WithUrl(rawUrl string) *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/reports/a009c4871b26fe61d6cab980d9a8fb4a2156df206bb8e4157235052353557f73.go b/reports/a009c4871b26fe61d6cab980d9a8fb4a2156df206bb8e4157235052353557f73.go new file mode 100644 index 00000000000..57cb6ede53d --- /dev/null +++ b/reports/a009c4871b26fe61d6cab980d9a8fb4a2156df206bb8e4157235052353557f73.go @@ -0,0 +1,99 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse() *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse { + m := &ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse{ + BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateServiceActivityValueMetricFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ServiceActivityValueMetricable when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable + SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) +} diff --git a/reports/a6fbaab0c2e7a3eb0a8f0f657d3f0631b0fd43d809d8a8ac02c609735e95d312.go b/reports/a6fbaab0c2e7a3eb0a8f0f657d3f0631b0fd43d809d8a8ac02c609735e95d312.go new file mode 100644 index 00000000000..df683f8c138 --- /dev/null +++ b/reports/a6fbaab0c2e7a3eb0a8f0f657d3f0631b0fd43d809d8a8ac02c609735e95d312.go @@ -0,0 +1,99 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" +) + +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse() *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse { + m := &ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse{ + BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateServiceActivityValueMetricFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []ServiceActivityValueMetricable when successful +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse) SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable + SetValue(value []ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ServiceActivityValueMetricable) +} diff --git a/reports/cc08ac4766da3be2f0ec057d458e201a6ee417fd9ada304d6148354f09e30baf.go b/reports/cc08ac4766da3be2f0ec057d458e201a6ee417fd9ada304d6148354f09e30baf.go new file mode 100644 index 00000000000..3271ff09ae5 --- /dev/null +++ b/reports/cc08ac4766da3be2f0ec057d458e201a6ee417fd9ada304d6148354f09e30baf.go @@ -0,0 +1,33 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse struct { + ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse +} + +// NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse instantiates a new ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse() *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse { + m := &ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse{ + ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse: *NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse(), nil +} + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable +} diff --git a/reports/e11b3d1ce1b0c46cf0d6938b6be30cc49e50ac56e969204436368c1aa4669f45.go b/reports/e11b3d1ce1b0c46cf0d6938b6be30cc49e50ac56e969204436368c1aa4669f45.go new file mode 100644 index 00000000000..36fcd8f5041 --- /dev/null +++ b/reports/e11b3d1ce1b0c46cf0d6938b6be30cc49e50ac56e969204436368c1aa4669f45.go @@ -0,0 +1,33 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse struct { + ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse() *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse { + m := &ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse{ + ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse: *NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(), + } + return m +} + +// CreateServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponse(), nil +} + +// Deprecated: This class is obsolete. Use ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable instead. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable +} diff --git a/reports/f85d54ebe209a2370b40e2910ee55f682a2c05a3561a9a19abd223ecf183d1fe.go b/reports/f85d54ebe209a2370b40e2910ee55f682a2c05a3561a9a19abd223ecf183d1fe.go new file mode 100644 index 00000000000..12287f0e518 --- /dev/null +++ b/reports/f85d54ebe209a2370b40e2910ee55f682a2c05a3561a9a19abd223ecf183d1fe.go @@ -0,0 +1,133 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package reports + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" +) + +// ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder provides operations to call the getMetricsForAgentIdAutonomousSignInSuccess method. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters retrieve the number of completed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. These sign-ins are distinct from Agent ID interactive sign-ins, in which agents sign in on behalf of human users. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters struct { + // Usage: aggregationIntervalInMinutes=@aggregationIntervalInMinutes + AggregationIntervalInMinutes *int32 "uriparametername:\"aggregationIntervalInMinutes\"" + // Include count of items + Count *bool "uriparametername:\"%24count\"" + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" + // Skip the first n items + Skip *int32 "uriparametername:\"%24skip\"" + // Show only the first n items + Top *int32 "uriparametername:\"%24top\"" +} + +// ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetQueryParameters +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter, exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + m := &ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/reports/serviceActivity/getMetricsForAgentIdAutonomousSignInSuccess(inclusiveIntervalStartDateTime={inclusiveIntervalStartDateTime},exclusiveIntervalEndDateTime={exclusiveIntervalEndDateTime},aggregationIntervalInMinutes=@aggregationIntervalInMinutes){?%24count,%24filter,%24search,%24skip,%24top,aggregationIntervalInMinutes*}", pathParameters), + } + if exclusiveIntervalEndDateTime != nil { + m.BaseRequestBuilder.PathParameters["exclusiveIntervalEndDateTime"] = (*exclusiveIntervalEndDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + if inclusiveIntervalStartDateTime != nil { + m.BaseRequestBuilder.PathParameters["inclusiveIntervalStartDateTime"] = (*inclusiveIntervalStartDateTime).Format(i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.RFC3339) + } + return m +} + +// NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder instantiates a new ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder and sets the default values. +func NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(urlParams, requestAdapter, nil, nil) +} + +// Get retrieve the number of completed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. These sign-ins are distinct from Agent ID interactive sign-ins, in which agents sign in on behalf of human users. +// Deprecated: This method is obsolete. Use GetAsGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse instead. +// returns a ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable 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/serviceactivity-getmetricsforagentidautonomoussigninsuccess?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) Get(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesResponseable), nil +} + +// GetAsGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse retrieve the number of completed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. These sign-ins are distinct from Agent ID interactive sign-ins, in which agents sign in on behalf of human users. +// returns a ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable 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/serviceactivity-getmetricsforagentidautonomoussigninsuccess?view=graph-rest-beta +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) GetAsGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponse(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesGetResponseable), nil +} + +// ToGetRequestInformation retrieve the number of completed autonomous sign-ins by Agent IDs during a specified time period. In Agent ID autonomous sign-ins, the agent signs in and acts as itself, including both Agent ID instances and designated service principals. These sign-ins are distinct from Agent ID interactive sign-ins, in which agents sign in on behalf of human users. +// returns a *RequestInformation when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder) WithUrl(rawUrl string) *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/reports/service_activity_request_builder.go b/reports/service_activity_request_builder.go index 9f1a9dac053..0f070b4163b 100644 --- a/reports/service_activity_request_builder.go +++ b/reports/service_activity_request_builder.go @@ -205,6 +205,30 @@ func (m *ServiceActivityRequestBuilder) GetMessageVolumeMetricsForTeamsChatWithI return NewServiceActivityGetMessageVolumeMetricsForTeamsChatWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, exclusiveIntervalEndDateTime, inclusiveIntervalStartDateTime) } +// GetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes provides operations to call the getMetricsForAgentIdAutonomousSignInFailure method. +// returns a *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityRequestBuilder) GetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes(exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, exclusiveIntervalEndDateTime, inclusiveIntervalStartDateTime) +} + +// GetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes provides operations to call the getMetricsForAgentIdAutonomousSignInSuccess method. +// returns a *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityRequestBuilder) GetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes(exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdAutonomousSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, exclusiveIntervalEndDateTime, inclusiveIntervalStartDateTime) +} + +// GetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes provides operations to call the getMetricsForAgentIdInteractiveSignInFailure method. +// returns a *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityRequestBuilder) GetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes(exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInFailureWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, exclusiveIntervalEndDateTime, inclusiveIntervalStartDateTime) +} + +// GetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes provides operations to call the getMetricsForAgentIdInteractiveSignInSuccess method. +// returns a *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful +func (m *ServiceActivityRequestBuilder) GetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes(exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { + return NewServiceActivityGetMetricsForAgentIdInteractiveSignInSuccessWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter, exclusiveIntervalEndDateTime, inclusiveIntervalStartDateTime) +} + // GetMetricsForConditionalAccessBlockedSignInWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes provides operations to call the getMetricsForConditionalAccessBlockedSignIn method. // returns a *ServiceActivityGetMetricsForConditionalAccessBlockedSignInWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder when successful func (m *ServiceActivityRequestBuilder) GetMetricsForConditionalAccessBlockedSignInWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutes(exclusiveIntervalEndDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time, inclusiveIntervalStartDateTime *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) *ServiceActivityGetMetricsForConditionalAccessBlockedSignInWithInclusiveIntervalStartDateTimeWithExclusiveIntervalEndDateTimeWithAggregationIntervalInMinutesRequestBuilder { diff --git a/security/0e786741c9db42934f485d4a96a143cf9f9505d77105f633128921bf0de0e27a.go b/security/0e786741c9db42934f485d4a96a143cf9f9505d77105f633128921bf0de0e27a.go new file mode 100644 index 00000000000..75a7fcab2a2 --- /dev/null +++ b/security/0e786741c9db42934f485d4a96a143cf9f9505d77105f633128921bf0de0e27a.go @@ -0,0 +1,127 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody() *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody { + m := &ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody(), nil +} + +// GetAccessCredential gets the accessCredential property value. Provider credential used to establish or refresh repository access. The concrete type(set via `@odata.type`) selects the credential style. All fields are input only and arenever returned. +// returns a RepositoryAccessCredentialable when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable { + val, err := m.GetBackingStore().Get("accessCredential") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["accessCredential"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositoryAccessCredentialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccessCredential(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable)) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("accessCredential", m.GetAccessCredential()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAccessCredential sets the accessCredential property value. Provider credential used to establish or refresh repository access. The concrete type(set via `@odata.type`) selects the credential style. All fields are input only and arenever returned. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) { + err := m.GetBackingStore().Set("accessCredential", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) +} diff --git a/security/26fd7afc1cb0f0c078d09fc7cb977b4cfab75d0283e3f4d1bc94c68ade861552.go b/security/26fd7afc1cb0f0c078d09fc7cb977b4cfab75d0283e3f4d1bc94c68ade861552.go new file mode 100644 index 00000000000..82b0601103d --- /dev/null +++ b/security/26fd7afc1cb0f0c078d09fc7cb977b4cfab75d0283e3f4d1bc94c68ade861552.go @@ -0,0 +1,82 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +// ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder provides operations to call the disconnect method. +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderInternal instantiates a new ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder and sets the default values. +func NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder { + m := &ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories/{contentManagementRepository%2Did}/microsoft.graph.security.contentManagement.disconnect", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder instantiates a new ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder and sets the default values. +func NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post disconnect a repository. Always removes the connection on the Sentinel side.The provider credential is optional: when supplied, repository-side artifacts(the deployment identity and setup pipeline) are cleaned up on a best-effort basis;when omitted, or if cleanup fails, the connection is still removed and any repository-sideartifacts that could not be removed are reported in the result. Disconnecting without acredential does not stop the repository from pushing until its identity is removed. +// returns a RepositoryDisconnectResultable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder) Post(ctx context.Context, body ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderPostRequestConfiguration) (i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryDisconnectResultable, 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, i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositoryDisconnectResultFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryDisconnectResultable), nil +} + +// ToPostRequestInformation disconnect a repository. Always removes the connection on the Sentinel side.The provider credential is optional: when supplied, repository-side artifacts(the deployment identity and setup pipeline) are cleaned up on a best-effort basis;when omitted, or if cleanup fails, the connection is still removed and any repository-sideartifacts that could not be removed are reported in the result. Disconnecting without acredential does not stop the repository from pushing until its identity is removed. +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder) ToPostRequestInformation(ctx context.Context, body ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderPostRequestConfiguration) (*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. +// returns a *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder { + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/2efc3996f775d3dca7dcfebca4f95ed443cb89114e0c467f0aed69f1ff03eae1.go b/security/2efc3996f775d3dca7dcfebca4f95ed443cb89114e0c467f0aed69f1ff03eae1.go new file mode 100644 index 00000000000..d4d2617922c --- /dev/null +++ b/security/2efc3996f775d3dca7dcfebca4f95ed443cb89114e0c467f0aed69f1ff03eae1.go @@ -0,0 +1,407 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody instantiates a new ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody and sets the default values. +func NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody() *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody { + m := &ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody(), nil +} + +// GetAccessCredential gets the accessCredential property value. The accessCredential property +// returns a RepositoryAccessCredentialable when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable { + val, err := m.GetBackingStore().Get("accessCredential") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetContentTypes gets the contentTypes property value. The contentTypes property +// returns a []RepositoryContentType when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetContentTypes() []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType { + val, err := m.GetBackingStore().Get("contentTypes") + if err != nil { + panic(err) + } + if val != nil { + return val.([]i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType) + } + return nil +} + +// GetDeploymentIdentity gets the deploymentIdentity property value. The deploymentIdentity property +// returns a DeploymentIdentityable when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetDeploymentIdentity() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable { + val, err := m.GetBackingStore().Get("deploymentIdentity") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable) + } + return nil +} + +// GetDeploymentScope gets the deploymentScope property value. The deploymentScope property +// returns a DeploymentScopeable when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetDeploymentScope() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable { + val, err := m.GetBackingStore().Get("deploymentScope") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable) + } + return nil +} + +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetDescription() *string { + val, err := m.GetBackingStore().Get("description") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayName gets the displayName property value. The displayName property +// returns a *string when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["accessCredential"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositoryAccessCredentialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccessCredential(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable)) + } + return nil + } + res["contentTypes"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ParseRepositoryContentType) + if err != nil { + return err + } + if val != nil { + res := make([]i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType)) + } + } + m.SetContentTypes(res) + } + return nil + } + res["deploymentIdentity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateDeploymentIdentityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentIdentity(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable)) + } + return nil + } + res["deploymentScope"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateDeploymentScopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentScope(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable)) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["repoType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ParseRepositoryType) + if err != nil { + return err + } + if val != nil { + m.SetRepoType(val.(*i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType)) + } + return nil + } + res["sourceLocation"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositorySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSourceLocation(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable)) + } + return nil + } + return res +} + +// GetRepoType gets the repoType property value. Source-control provider. +// returns a *RepositoryType when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetRepoType() *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType { + val, err := m.GetBackingStore().Get("repoType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType) + } + return nil +} + +// GetSourceLocation gets the sourceLocation property value. The sourceLocation property +// returns a RepositorySettingsable when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) GetSourceLocation() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable { + val, err := m.GetBackingStore().Get("sourceLocation") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("accessCredential", m.GetAccessCredential()) + if err != nil { + return err + } + } + if m.GetContentTypes() != nil { + err := writer.WriteCollectionOfStringValues("contentTypes", i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.SerializeRepositoryContentType(m.GetContentTypes())) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deploymentIdentity", m.GetDeploymentIdentity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deploymentScope", m.GetDeploymentScope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + if m.GetRepoType() != nil { + cast := (*m.GetRepoType()).String() + err := writer.WriteStringValue("repoType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("sourceLocation", m.GetSourceLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAccessCredential sets the accessCredential property value. The accessCredential property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) { + err := m.GetBackingStore().Set("accessCredential", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetContentTypes sets the contentTypes property value. The contentTypes property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetContentTypes(value []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType) { + err := m.GetBackingStore().Set("contentTypes", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentIdentity sets the deploymentIdentity property value. The deploymentIdentity property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetDeploymentIdentity(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable) { + err := m.GetBackingStore().Set("deploymentIdentity", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentScope sets the deploymentScope property value. The deploymentScope property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetDeploymentScope(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable) { + err := m.GetBackingStore().Set("deploymentScope", value) + if err != nil { + panic(err) + } +} + +// SetDescription sets the description property value. The description property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetDescription(value *string) { + err := m.GetBackingStore().Set("description", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. The displayName property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetRepoType sets the repoType property value. Source-control provider. +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetRepoType(value *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType) { + err := m.GetBackingStore().Set("repoType", value) + if err != nil { + panic(err) + } +} + +// SetSourceLocation sets the sourceLocation property value. The sourceLocation property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBody) SetSourceLocation(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable) { + err := m.GetBackingStore().Set("sourceLocation", value) + if err != nil { + panic(err) + } +} + +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetContentTypes() []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType + GetDeploymentIdentity() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable + GetDeploymentScope() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable + GetDescription() *string + GetDisplayName() *string + GetRepoType() *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType + GetSourceLocation() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable + SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetContentTypes(value []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType) + SetDeploymentIdentity(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable) + SetDeploymentScope(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable) + SetDescription(value *string) + SetDisplayName(value *string) + SetRepoType(value *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType) + SetSourceLocation(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable) +} diff --git a/security/3e90c118005b134cae1aeb615c3967dce9ced1e2e46d124e93b3a54ebc429262.go b/security/3e90c118005b134cae1aeb615c3967dce9ced1e2e46d124e93b3a54ebc429262.go new file mode 100644 index 00000000000..0b39446401c --- /dev/null +++ b/security/3e90c118005b134cae1aeb615c3967dce9ced1e2e46d124e93b3a54ebc429262.go @@ -0,0 +1,127 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody instantiates a new ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody and sets the default values. +func NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody() *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody { + m := &ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody(), nil +} + +// GetAccessCredential gets the accessCredential property value. The accessCredential property +// returns a RepositoryAccessCredentialable when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable { + val, err := m.GetBackingStore().Get("accessCredential") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["accessCredential"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositoryAccessCredentialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccessCredential(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable)) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("accessCredential", m.GetAccessCredential()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAccessCredential sets the accessCredential property value. The accessCredential property +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) { + err := m.GetBackingStore().Set("accessCredential", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectDisconnectPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) +} diff --git a/security/6706f75634821d790d9995005fddc4ef6873b69dc8d059cd21493ed57a60e8cb.go b/security/6706f75634821d790d9995005fddc4ef6873b69dc8d059cd21493ed57a60e8cb.go new file mode 100644 index 00000000000..bd25a03727e --- /dev/null +++ b/security/6706f75634821d790d9995005fddc4ef6873b69dc8d059cd21493ed57a60e8cb.go @@ -0,0 +1,33 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deprecated: This class is obsolete. Use ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable instead. +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse struct { + ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse() *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse { + m := &ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse{ + ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse: *NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse(), + } + return m +} + +// CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponse(), nil +} + +// Deprecated: This class is obsolete. Use ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable instead. +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseable interface { + ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/security/77be96984bf1feaedce794795ed9847a9c7f5c29bbc4ea99dc5a6fda1c7a944e.go b/security/77be96984bf1feaedce794795ed9847a9c7f5c29bbc4ea99dc5a6fda1c7a944e.go new file mode 100644 index 00000000000..c84e49947c0 --- /dev/null +++ b/security/77be96984bf1feaedce794795ed9847a9c7f5c29bbc4ea99dc5a6fda1c7a944e.go @@ -0,0 +1,100 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse struct { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponse +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse() *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse { + m := &ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse{ + BaseCollectionPaginationCountResponse: *ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.NewBaseCollectionPaginationCountResponse(), + } + return m +} + +// CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse(), nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := m.BaseCollectionPaginationCountResponse.GetFieldDeserializers() + res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateDiscoveredRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable) + } + } + m.SetValue(res) + } + return nil + } + return res +} + +// GetValue gets the value property value. The value property +// returns a []DiscoveredRepositoryable when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse) GetValue() []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable { + val, err := m.GetBackingStore().Get("value") + if err != nil { + panic(err) + } + if val != nil { + return val.([]i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + err := m.BaseCollectionPaginationCountResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetValue() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetValue())) + for i, v := range m.GetValue() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("value", cast) + if err != nil { + return err + } + } + return nil +} + +// SetValue sets the value property value. The value property +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponse) SetValue(value []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable) { + err := m.GetBackingStore().Set("value", value) + if err != nil { + panic(err) + } +} + +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable interface { + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.BaseCollectionPaginationCountResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetValue() []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable + SetValue(value []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DiscoveredRepositoryable) +} diff --git a/security/a2d8649d082e8dfd36149621cb5bdfdd9bb14149221458dd455a91ba2ff23f20.go b/security/a2d8649d082e8dfd36149621cb5bdfdd9bb14149221458dd455a91ba2ff23f20.go index a6acfebae37..1e626850a49 100644 --- a/security/a2d8649d082e8dfd36149621cb5bdfdd9bb14149221458dd455a91ba2ff23f20.go +++ b/security/a2d8649d082e8dfd36149621cb5bdfdd9bb14149221458dd455a91ba2ff23f20.go @@ -23,7 +23,7 @@ type CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemR Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } -// CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilderGetQueryParameters the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilderGetQueryParameters the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. type CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -81,7 +81,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionI return nil } -// Get the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// Get the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. // returns a SlaPolicyDefinitionable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilderGetRequestConfiguration) (i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.SlaPolicyDefinitionable, error) { @@ -135,7 +135,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionI return requestInfo, nil } -// ToGetRequestInformation the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// ToGetRequestInformation the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. // returns a *RequestInformation when successful func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemSlaPoliciesSlaPolicyDefinitionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/security/agentic_security_playbook_definitions_playbook_definition_item_request_builder.go b/security/agentic_security_playbook_definitions_playbook_definition_item_request_builder.go new file mode 100644 index 00000000000..3b24c9eda02 --- /dev/null +++ b/security/agentic_security_playbook_definitions_playbook_definition_item_request_builder.go @@ -0,0 +1,94 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder provides operations to manage the playbookDefinitions property of the microsoft.graph.agenticSecurityRoot entity. +type AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetQueryParameters get a playbook definition from the catalog or the definition selected by an agentic session. This operation uses the playbookDefinition resource. +type AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetQueryParameters +} + +// NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderInternal instantiates a new AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder and sets the default values. +func NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder { + m := &AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/playbookDefinitions/{playbookDefinition%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder instantiates a new AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder and sets the default values. +func NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get a playbook definition from the catalog or the definition selected by an agentic session. This operation uses the playbookDefinition resource. +// returns a PlaybookDefinitionable 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/playbookdefinition-get?view=graph-rest-beta +func (m *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlaybookDefinitionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreatePlaybookDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlaybookDefinitionable), nil +} + +// ToGetRequestInformation get a playbook definition from the catalog or the definition selected by an agentic session. This operation uses the playbookDefinition resource. +// returns a *RequestInformation when successful +func (m *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder when successful +func (m *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder { + return NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_playbook_definitions_request_builder.go b/security/agentic_security_playbook_definitions_request_builder.go new file mode 100644 index 00000000000..3964c92b2ae --- /dev/null +++ b/security/agentic_security_playbook_definitions_request_builder.go @@ -0,0 +1,119 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecurityPlaybookDefinitionsRequestBuilder provides operations to manage the playbookDefinitions property of the microsoft.graph.agenticSecurityRoot entity. +type AgenticSecurityPlaybookDefinitionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecurityPlaybookDefinitionsRequestBuilderGetQueryParameters list the read-only playbook catalog available to the signed-in user. This operation uses the playbookDefinition resource. +type AgenticSecurityPlaybookDefinitionsRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecurityPlaybookDefinitionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecurityPlaybookDefinitionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecurityPlaybookDefinitionsRequestBuilderGetQueryParameters +} + +// ByPlaybookDefinitionId provides operations to manage the playbookDefinitions property of the microsoft.graph.agenticSecurityRoot entity. +// returns a *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder when successful +func (m *AgenticSecurityPlaybookDefinitionsRequestBuilder) ByPlaybookDefinitionId(playbookDefinitionId string) *AgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if playbookDefinitionId != "" { + urlTplParams["playbookDefinition%2Did"] = playbookDefinitionId + } + return NewAgenticSecurityPlaybookDefinitionsPlaybookDefinitionItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecurityPlaybookDefinitionsRequestBuilderInternal instantiates a new AgenticSecurityPlaybookDefinitionsRequestBuilder and sets the default values. +func NewAgenticSecurityPlaybookDefinitionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecurityPlaybookDefinitionsRequestBuilder { + m := &AgenticSecurityPlaybookDefinitionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/playbookDefinitions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecurityPlaybookDefinitionsRequestBuilder instantiates a new AgenticSecurityPlaybookDefinitionsRequestBuilder and sets the default values. +func NewAgenticSecurityPlaybookDefinitionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecurityPlaybookDefinitionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecurityPlaybookDefinitionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get list the read-only playbook catalog available to the signed-in user. This operation uses the playbookDefinition resource. +// returns a PlaybookDefinitionCollectionResponseable 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/agenticsecurityroot-list-playbookdefinitions?view=graph-rest-beta +func (m *AgenticSecurityPlaybookDefinitionsRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecurityPlaybookDefinitionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlaybookDefinitionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreatePlaybookDefinitionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlaybookDefinitionCollectionResponseable), nil +} + +// ToGetRequestInformation list the read-only playbook catalog available to the signed-in user. This operation uses the playbookDefinition resource. +// returns a *RequestInformation when successful +func (m *AgenticSecurityPlaybookDefinitionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecurityPlaybookDefinitionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecurityPlaybookDefinitionsRequestBuilder when successful +func (m *AgenticSecurityPlaybookDefinitionsRequestBuilder) WithUrl(rawUrl string) *AgenticSecurityPlaybookDefinitionsRequestBuilder { + return NewAgenticSecurityPlaybookDefinitionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_request_builder.go b/security/agentic_security_request_builder.go new file mode 100644 index 00000000000..c831ed488b1 --- /dev/null +++ b/security/agentic_security_request_builder.go @@ -0,0 +1,40 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AgenticSecurityRequestBuilder builds and executes requests for operations under \security\agenticSecurity +type AgenticSecurityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// NewAgenticSecurityRequestBuilderInternal instantiates a new AgenticSecurityRequestBuilder and sets the default values. +func NewAgenticSecurityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecurityRequestBuilder { + m := &AgenticSecurityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity", pathParameters), + } + return m +} + +// NewAgenticSecurityRequestBuilder instantiates a new AgenticSecurityRequestBuilder and sets the default values. +func NewAgenticSecurityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecurityRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecurityRequestBuilderInternal(urlParams, requestAdapter) +} + +// PlaybookDefinitions provides operations to manage the playbookDefinitions property of the microsoft.graph.agenticSecurityRoot entity. +// returns a *AgenticSecurityPlaybookDefinitionsRequestBuilder when successful +func (m *AgenticSecurityRequestBuilder) PlaybookDefinitions() *AgenticSecurityPlaybookDefinitionsRequestBuilder { + return NewAgenticSecurityPlaybookDefinitionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Sessions provides operations to manage the sessions property of the microsoft.graph.agenticSecurityRoot entity. +// returns a *AgenticSecuritySessionsRequestBuilder when successful +func (m *AgenticSecurityRequestBuilder) Sessions() *AgenticSecuritySessionsRequestBuilder { + return NewAgenticSecuritySessionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_investigation_session_item_request_builder.go b/security/agentic_security_sessions_investigation_session_item_request_builder.go new file mode 100644 index 00000000000..58681812f36 --- /dev/null +++ b/security/agentic_security_sessions_investigation_session_item_request_builder.go @@ -0,0 +1,130 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsInvestigationSessionItemRequestBuilder provides operations to manage the sessions property of the microsoft.graph.agenticSecurityRoot entity. +type AgenticSecuritySessionsInvestigationSessionItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetQueryParameters get an agentic session and poll its processing status. This operation uses the agentic session resource. +type AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetQueryParameters +} + +// AgentRuns provides operations to manage the agentRuns property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemAgentRunsRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) AgentRuns() *AgenticSecuritySessionsItemAgentRunsRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Cancel provides operations to call the cancel method. +// returns a *AgenticSecuritySessionsItemCancelRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) Cancel() *AgenticSecuritySessionsItemCancelRequestBuilder { + return NewAgenticSecuritySessionsItemCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilderInternal instantiates a new AgenticSecuritySessionsInvestigationSessionItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder { + m := &AgenticSecuritySessionsInvestigationSessionItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilder instantiates a new AgenticSecuritySessionsInvestigationSessionItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get an agentic session and poll its processing status. This operation uses the agentic session resource. +// returns a InvestigationSessionable 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/investigationsession-get?view=graph-rest-beta +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationSessionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable), nil +} + +// Inputs provides operations to manage the inputs property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemInputsRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) Inputs() *AgenticSecuritySessionsItemInputsRequestBuilder { + return NewAgenticSecuritySessionsItemInputsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Messages provides operations to manage the messages property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemMessagesRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) Messages() *AgenticSecuritySessionsItemMessagesRequestBuilder { + return NewAgenticSecuritySessionsItemMessagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Outputs provides operations to manage the outputs property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemOutputsRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) Outputs() *AgenticSecuritySessionsItemOutputsRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// PlaybookDefinition provides operations to manage the playbookDefinition property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) PlaybookDefinition() *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder { + return NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToGetRequestInformation get an agentic session and poll its processing status. This operation uses the agentic session resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsInvestigationSessionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder when successful +func (m *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder { + return NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_agent_runs_agent_run_item_request_builder.go b/security/agentic_security_sessions_item_agent_runs_agent_run_item_request_builder.go new file mode 100644 index 00000000000..9ee9e2c4cee --- /dev/null +++ b/security/agentic_security_sessions_item_agent_runs_agent_run_item_request_builder.go @@ -0,0 +1,100 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder provides operations to manage the agentRuns property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetQueryParameters get an agent run and its processing status. This operation uses the agentRun resource. List the session's agent runs to find the run id. Use that value unchanged with the same parent session identifier; the embedded agent object's key isn't the run identifier. Use this method to inspect one agent's execution. For the overall playbook state, get the parent session rather than inferring it from an individual run. +type AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder { + m := &AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/agentRuns/{agentRun%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder instantiates a new AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get an agent run and its processing status. This operation uses the agentRun resource. List the session's agent runs to find the run id. Use that value unchanged with the same parent session identifier; the embedded agent object's key isn't the run identifier. Use this method to inspect one agent's execution. For the overall playbook state, get the parent session rather than inferring it from an individual run. +// returns a AgentRunable 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/agentrun-get?view=graph-rest-beta +func (m *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.AgentRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateAgentRunFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.AgentRunable), nil +} + +// Messages provides operations to manage the messages property of the microsoft.graph.agentRun entity. +// returns a *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder) Messages() *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToGetRequestInformation get an agent run and its processing status. This operation uses the agentRun resource. List the session's agent runs to find the run id. Use that value unchanged with the same parent session identifier; the embedded agent object's key isn't the run identifier. Use this method to inspect one agent's execution. For the overall playbook state, get the parent session rather than inferring it from an individual run. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_agent_runs_count_request_builder.go b/security/agentic_security_sessions_item_agent_runs_count_request_builder.go new file mode 100644 index 00000000000..7c5c003140c --- /dev/null +++ b/security/agentic_security_sessions_item_agent_runs_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemAgentRunsCountRequestBuilder provides operations to count the resources in the collection. +type AgenticSecuritySessionsItemAgentRunsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetQueryParameters get the number of the resource +type AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemAgentRunsCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder { + m := &AgenticSecuritySessionsItemAgentRunsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/agentRuns/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilder instantiates a new AgenticSecuritySessionsItemAgentRunsCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_agent_runs_item_messages_count_request_builder.go b/security/agentic_security_sessions_item_agent_runs_item_messages_count_request_builder.go new file mode 100644 index 00000000000..749a5679b1b --- /dev/null +++ b/security/agentic_security_sessions_item_agent_runs_item_messages_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder provides operations to count the resources in the collection. +type AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetQueryParameters get the number of the resource +type AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder { + m := &AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/agentRuns/{agentRun%2Did}/messages/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder instantiates a new AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_agent_runs_item_messages_investigation_message_item_request_builder.go b/security/agentic_security_sessions_item_agent_runs_item_messages_investigation_message_item_request_builder.go new file mode 100644 index 00000000000..023301b11a6 --- /dev/null +++ b/security/agentic_security_sessions_item_agent_runs_item_messages_investigation_message_item_request_builder.go @@ -0,0 +1,91 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder provides operations to manage the messages property of the microsoft.graph.agentRun entity. +type AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetQueryParameters read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +type AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder { + m := &AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/agentRuns/{agentRun%2Did}/messages/{investigationMessage%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder instantiates a new AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +// returns a InvestigationMessageable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationMessageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageable), nil +} + +// ToGetRequestInformation read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_agent_runs_item_messages_request_builder.go b/security/agentic_security_sessions_item_agent_runs_item_messages_request_builder.go new file mode 100644 index 00000000000..1f4540cb3d6 --- /dev/null +++ b/security/agentic_security_sessions_item_agent_runs_item_messages_request_builder.go @@ -0,0 +1,122 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder provides operations to manage the messages property of the microsoft.graph.agentRun entity. +type AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetQueryParameters read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +type AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetQueryParameters +} + +// ByInvestigationMessageId provides operations to manage the messages property of the microsoft.graph.agentRun entity. +// returns a *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder) ByInvestigationMessageId(investigationMessageId string) *AgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if investigationMessageId != "" { + urlTplParams["investigationMessage%2Did"] = investigationMessageId + } + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesInvestigationMessageItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder { + m := &AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/agentRuns/{agentRun%2Did}/messages{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder instantiates a new AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder) Count() *AgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +// returns a InvestigationMessageCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationMessageCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageCollectionResponseable), nil +} + +// ToGetRequestInformation read-only investigation messages contained by this run; id maps backend messageId. Supports collection and keyed reads. Message creation is not supported. Collection overflow requires an @odata.nextLink preserving tenant, caller, parent and query context; this schema requirement does not attest runtime implementation. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsItemMessagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_agent_runs_request_builder.go b/security/agentic_security_sessions_item_agent_runs_request_builder.go new file mode 100644 index 00000000000..f01c9fc318a --- /dev/null +++ b/security/agentic_security_sessions_item_agent_runs_request_builder.go @@ -0,0 +1,125 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemAgentRunsRequestBuilder provides operations to manage the agentRuns property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemAgentRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemAgentRunsRequestBuilderGetQueryParameters list the agent runs owned by an agentic session. This operation uses the agentRun resource. Use this method to inspect individual agents contributing to a session. To monitor the overall playbook execution, get the session and inspect its status instead of inferring the session state from one agent run. +type AgenticSecuritySessionsItemAgentRunsRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecuritySessionsItemAgentRunsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemAgentRunsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemAgentRunsRequestBuilderGetQueryParameters +} + +// ByAgentRunId provides operations to manage the agentRuns property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsRequestBuilder) ByAgentRunId(agentRunId string) *AgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if agentRunId != "" { + urlTplParams["agentRun%2Did"] = agentRunId + } + return NewAgenticSecuritySessionsItemAgentRunsAgentRunItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsItemAgentRunsRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemAgentRunsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsRequestBuilder { + m := &AgenticSecuritySessionsItemAgentRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/agentRuns{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemAgentRunsRequestBuilder instantiates a new AgenticSecuritySessionsItemAgentRunsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemAgentRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemAgentRunsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemAgentRunsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsRequestBuilder) Count() *AgenticSecuritySessionsItemAgentRunsCountRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get list the agent runs owned by an agentic session. This operation uses the agentRun resource. Use this method to inspect individual agents contributing to a session. To monitor the overall playbook execution, get the session and inspect its status instead of inferring the session state from one agent run. +// returns a AgentRunCollectionResponseable 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/investigationsession-list-agentruns?view=graph-rest-beta +func (m *AgenticSecuritySessionsItemAgentRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.AgentRunCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateAgentRunCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.AgentRunCollectionResponseable), nil +} + +// ToGetRequestInformation list the agent runs owned by an agentic session. This operation uses the agentRun resource. Use this method to inspect individual agents contributing to a session. To monitor the overall playbook execution, get the session and inspect its status instead of inferring the session state from one agent run. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemAgentRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemAgentRunsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemAgentRunsRequestBuilder when successful +func (m *AgenticSecuritySessionsItemAgentRunsRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemAgentRunsRequestBuilder { + return NewAgenticSecuritySessionsItemAgentRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_cancel_request_builder.go b/security/agentic_security_sessions_item_cancel_request_builder.go new file mode 100644 index 00000000000..9027eb0bb1c --- /dev/null +++ b/security/agentic_security_sessions_item_cancel_request_builder.go @@ -0,0 +1,81 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemCancelRequestBuilder provides operations to call the cancel method. +type AgenticSecuritySessionsItemCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemCancelRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemCancelRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewAgenticSecuritySessionsItemCancelRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemCancelRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemCancelRequestBuilder { + m := &AgenticSecuritySessionsItemCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/cancel", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemCancelRequestBuilder instantiates a new AgenticSecuritySessionsItemCancelRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemCancelRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemCancelRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post request asynchronous cancellation of an agentic session. This operation uses the agentic session resource. +// returns a InvestigationSessionable 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/investigationsession-cancel?view=graph-rest-beta +func (m *AgenticSecuritySessionsItemCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemCancelRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationSessionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable), nil +} + +// ToPostRequestInformation request asynchronous cancellation of an agentic session. This operation uses the agentic session resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemCancelRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemCancelRequestBuilderPostRequestConfiguration) (*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") + 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. +// returns a *AgenticSecuritySessionsItemCancelRequestBuilder when successful +func (m *AgenticSecuritySessionsItemCancelRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemCancelRequestBuilder { + return NewAgenticSecuritySessionsItemCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_inputs_count_request_builder.go b/security/agentic_security_sessions_item_inputs_count_request_builder.go new file mode 100644 index 00000000000..9dd502fc45b --- /dev/null +++ b/security/agentic_security_sessions_item_inputs_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemInputsCountRequestBuilder provides operations to count the resources in the collection. +type AgenticSecuritySessionsItemInputsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemInputsCountRequestBuilderGetQueryParameters get the number of the resource +type AgenticSecuritySessionsItemInputsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// AgenticSecuritySessionsItemInputsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemInputsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemInputsCountRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemInputsCountRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemInputsCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemInputsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemInputsCountRequestBuilder { + m := &AgenticSecuritySessionsItemInputsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/inputs/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemInputsCountRequestBuilder instantiates a new AgenticSecuritySessionsItemInputsCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemInputsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemInputsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemInputsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemInputsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemInputsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemInputsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemInputsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *AgenticSecuritySessionsItemInputsCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemInputsCountRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemInputsCountRequestBuilder { + return NewAgenticSecuritySessionsItemInputsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_inputs_investigation_input_item_request_builder.go b/security/agentic_security_sessions_item_inputs_investigation_input_item_request_builder.go new file mode 100644 index 00000000000..319df635e7a --- /dev/null +++ b/security/agentic_security_sessions_item_inputs_investigation_input_item_request_builder.go @@ -0,0 +1,94 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder provides operations to manage the inputs property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetQueryParameters get an input reference contained by an agentic session. This operation uses the agentic input resource. +type AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder { + m := &AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/inputs/{investigationInput%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder instantiates a new AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get an input reference contained by an agentic session. This operation uses the agentic input resource. +// returns a InvestigationInputable 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/investigationinput-get?view=graph-rest-beta +func (m *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationInputable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationInputFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationInputable), nil +} + +// ToGetRequestInformation get an input reference contained by an agentic session. This operation uses the agentic input resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder { + return NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_inputs_request_builder.go b/security/agentic_security_sessions_item_inputs_request_builder.go new file mode 100644 index 00000000000..a1064491bd0 --- /dev/null +++ b/security/agentic_security_sessions_item_inputs_request_builder.go @@ -0,0 +1,125 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemInputsRequestBuilder provides operations to manage the inputs property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemInputsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemInputsRequestBuilderGetQueryParameters list the shared input references contained by an agentic session. This operation uses the agentic input resource. +type AgenticSecuritySessionsItemInputsRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecuritySessionsItemInputsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemInputsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemInputsRequestBuilderGetQueryParameters +} + +// ByInvestigationInputId provides operations to manage the inputs property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemInputsRequestBuilder) ByInvestigationInputId(investigationInputId string) *AgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if investigationInputId != "" { + urlTplParams["investigationInput%2Did"] = investigationInputId + } + return NewAgenticSecuritySessionsItemInputsInvestigationInputItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsItemInputsRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemInputsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemInputsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemInputsRequestBuilder { + m := &AgenticSecuritySessionsItemInputsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/inputs{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemInputsRequestBuilder instantiates a new AgenticSecuritySessionsItemInputsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemInputsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemInputsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemInputsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *AgenticSecuritySessionsItemInputsCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemInputsRequestBuilder) Count() *AgenticSecuritySessionsItemInputsCountRequestBuilder { + return NewAgenticSecuritySessionsItemInputsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get list the shared input references contained by an agentic session. This operation uses the agentic input resource. +// returns a InvestigationInputCollectionResponseable 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/investigationsession-list-inputs?view=graph-rest-beta +func (m *AgenticSecuritySessionsItemInputsRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemInputsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationInputCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationInputCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationInputCollectionResponseable), nil +} + +// ToGetRequestInformation list the shared input references contained by an agentic session. This operation uses the agentic input resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemInputsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemInputsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemInputsRequestBuilder when successful +func (m *AgenticSecuritySessionsItemInputsRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemInputsRequestBuilder { + return NewAgenticSecuritySessionsItemInputsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_messages_count_request_builder.go b/security/agentic_security_sessions_item_messages_count_request_builder.go new file mode 100644 index 00000000000..ba693730cb6 --- /dev/null +++ b/security/agentic_security_sessions_item_messages_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemMessagesCountRequestBuilder provides operations to count the resources in the collection. +type AgenticSecuritySessionsItemMessagesCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemMessagesCountRequestBuilderGetQueryParameters get the number of the resource +type AgenticSecuritySessionsItemMessagesCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// AgenticSecuritySessionsItemMessagesCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemMessagesCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemMessagesCountRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemMessagesCountRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemMessagesCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemMessagesCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemMessagesCountRequestBuilder { + m := &AgenticSecuritySessionsItemMessagesCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/messages/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemMessagesCountRequestBuilder instantiates a new AgenticSecuritySessionsItemMessagesCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemMessagesCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemMessagesCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemMessagesCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemMessagesCountRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemMessagesCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemMessagesCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemMessagesCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *AgenticSecuritySessionsItemMessagesCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemMessagesCountRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemMessagesCountRequestBuilder { + return NewAgenticSecuritySessionsItemMessagesCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_messages_investigation_message_item_request_builder.go b/security/agentic_security_sessions_item_messages_investigation_message_item_request_builder.go new file mode 100644 index 00000000000..5bfb2170707 --- /dev/null +++ b/security/agentic_security_sessions_item_messages_investigation_message_item_request_builder.go @@ -0,0 +1,91 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder provides operations to manage the messages property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetQueryParameters read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +type AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder { + m := &AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/messages/{investigationMessage%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder instantiates a new AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +// returns a InvestigationMessageable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationMessageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageable), nil +} + +// ToGetRequestInformation read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder { + return NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_messages_request_builder.go b/security/agentic_security_sessions_item_messages_request_builder.go new file mode 100644 index 00000000000..1805ccfad1f --- /dev/null +++ b/security/agentic_security_sessions_item_messages_request_builder.go @@ -0,0 +1,122 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemMessagesRequestBuilder provides operations to manage the messages property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemMessagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemMessagesRequestBuilderGetQueryParameters read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +type AgenticSecuritySessionsItemMessagesRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecuritySessionsItemMessagesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemMessagesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemMessagesRequestBuilderGetQueryParameters +} + +// ByInvestigationMessageId provides operations to manage the messages property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemMessagesRequestBuilder) ByInvestigationMessageId(investigationMessageId string) *AgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if investigationMessageId != "" { + urlTplParams["investigationMessage%2Did"] = investigationMessageId + } + return NewAgenticSecuritySessionsItemMessagesInvestigationMessageItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsItemMessagesRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemMessagesRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemMessagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemMessagesRequestBuilder { + m := &AgenticSecuritySessionsItemMessagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/messages{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemMessagesRequestBuilder instantiates a new AgenticSecuritySessionsItemMessagesRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemMessagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemMessagesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemMessagesRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *AgenticSecuritySessionsItemMessagesCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemMessagesRequestBuilder) Count() *AgenticSecuritySessionsItemMessagesCountRequestBuilder { + return NewAgenticSecuritySessionsItemMessagesCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +// returns a InvestigationMessageCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemMessagesRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemMessagesRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationMessageCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationMessageCollectionResponseable), nil +} + +// ToGetRequestInformation read-only aggregate references to the same investigation messages contained by this session's agent runs. id maps backend messageId and is unique across the session; the canonical identity belongs to the owning run. The provider preserves owning-run authorization, list/keyed GET with $select and server-driven paging. No direct or deep insert; this schema requirement does not attest runtime implementation. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemMessagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemMessagesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemMessagesRequestBuilder when successful +func (m *AgenticSecuritySessionsItemMessagesRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemMessagesRequestBuilder { + return NewAgenticSecuritySessionsItemMessagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_outputs_count_request_builder.go b/security/agentic_security_sessions_item_outputs_count_request_builder.go new file mode 100644 index 00000000000..7e30f8238c4 --- /dev/null +++ b/security/agentic_security_sessions_item_outputs_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemOutputsCountRequestBuilder provides operations to count the resources in the collection. +type AgenticSecuritySessionsItemOutputsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemOutputsCountRequestBuilderGetQueryParameters get the number of the resource +type AgenticSecuritySessionsItemOutputsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// AgenticSecuritySessionsItemOutputsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemOutputsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemOutputsCountRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemOutputsCountRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemOutputsCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsCountRequestBuilder { + m := &AgenticSecuritySessionsItemOutputsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/outputs/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemOutputsCountRequestBuilder instantiates a new AgenticSecuritySessionsItemOutputsCountRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemOutputsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemOutputsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemOutputsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *AgenticSecuritySessionsItemOutputsCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsCountRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemOutputsCountRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_outputs_investigation_output_item_request_builder.go b/security/agentic_security_sessions_item_outputs_investigation_output_item_request_builder.go new file mode 100644 index 00000000000..cd34d077a16 --- /dev/null +++ b/security/agentic_security_sessions_item_outputs_investigation_output_item_request_builder.go @@ -0,0 +1,97 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder provides operations to manage the outputs property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetQueryParameters the read-only stored-file outputs owned by this session. Supports list and keyed GET with $select, server-driven paging, and authenticated content downloads. +type AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder { + m := &AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/outputs/{investigationOutput%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder instantiates a new AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Content provides operations to manage the media for the security entity. +// returns a *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder) Content() *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the read-only stored-file outputs owned by this session. Supports list and keyed GET with $select, server-driven paging, and authenticated content downloads. +// returns a InvestigationOutputable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationOutputable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationOutputFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationOutputable), nil +} + +// ToGetRequestInformation the read-only stored-file outputs owned by this session. Supports list and keyed GET with $select, server-driven paging, and authenticated content downloads. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_outputs_item_content_request_builder.go b/security/agentic_security_sessions_item_outputs_item_content_request_builder.go new file mode 100644 index 00000000000..33735cc7ec7 --- /dev/null +++ b/security/agentic_security_sessions_item_outputs_item_content_request_builder.go @@ -0,0 +1,157 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemOutputsItemContentRequestBuilder provides operations to manage the media for the security entity. +type AgenticSecuritySessionsItemOutputsItemContentRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemOutputsItemContentRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemOutputsItemContentRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// AgenticSecuritySessionsItemOutputsItemContentRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemOutputsItemContentRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// AgenticSecuritySessionsItemOutputsItemContentRequestBuilderPutRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemOutputsItemContentRequestBuilderPutRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemOutputsItemContentRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder { + m := &AgenticSecuritySessionsItemOutputsItemContentRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/outputs/{investigationOutput%2Did}/content", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilder instantiates a new AgenticSecuritySessionsItemOutputsItemContentRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete the output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) Delete(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsItemContentRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a []byte when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsItemContentRequestBuilderGetRequestConfiguration) ([]byte, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.([]byte), nil +} + +// Put the output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a InvestigationOutputable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) Put(ctx context.Context, body []byte, requestConfiguration *AgenticSecuritySessionsItemOutputsItemContentRequestBuilderPutRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationOutputable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationOutputFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationOutputable), nil +} + +// ToDeleteRequestInformation the output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsItemContentRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsItemContentRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/octet-stream, application/json") + return requestInfo, nil +} + +// ToPutRequestInformation the output bytes, retrieved through /security/agenticSecurity/sessions/{session-id}/outputs/{output-id}/content. The stream isn't inline in the metadata response. Read-only. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) ToPutRequestInformation(ctx context.Context, body []byte, requestConfiguration *AgenticSecuritySessionsItemOutputsItemContentRequestBuilderPutRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + requestInfo.SetStreamContentAndContentType(body, "application/octet-stream") + 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. +// returns a *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemOutputsItemContentRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsItemContentRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_outputs_request_builder.go b/security/agentic_security_sessions_item_outputs_request_builder.go new file mode 100644 index 00000000000..e7b0b548d4c --- /dev/null +++ b/security/agentic_security_sessions_item_outputs_request_builder.go @@ -0,0 +1,125 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemOutputsRequestBuilder provides operations to manage the outputs property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemOutputsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemOutputsRequestBuilderGetQueryParameters list the stored-file outputs owned by an agentic session. This operation uses the agentic output resource. +type AgenticSecuritySessionsItemOutputsRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecuritySessionsItemOutputsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemOutputsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemOutputsRequestBuilderGetQueryParameters +} + +// ByInvestigationOutputId provides operations to manage the outputs property of the microsoft.graph.investigationSession entity. +// returns a *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsRequestBuilder) ByInvestigationOutputId(investigationOutputId string) *AgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if investigationOutputId != "" { + urlTplParams["investigationOutput%2Did"] = investigationOutputId + } + return NewAgenticSecuritySessionsItemOutputsInvestigationOutputItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsItemOutputsRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemOutputsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsRequestBuilder { + m := &AgenticSecuritySessionsItemOutputsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/outputs{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemOutputsRequestBuilder instantiates a new AgenticSecuritySessionsItemOutputsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemOutputsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemOutputsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemOutputsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *AgenticSecuritySessionsItemOutputsCountRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsRequestBuilder) Count() *AgenticSecuritySessionsItemOutputsCountRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get list the stored-file outputs owned by an agentic session. This operation uses the agentic output resource. +// returns a InvestigationOutputCollectionResponseable 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/investigationsession-list-outputs?view=graph-rest-beta +func (m *AgenticSecuritySessionsItemOutputsRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationOutputCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationOutputCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationOutputCollectionResponseable), nil +} + +// ToGetRequestInformation list the stored-file outputs owned by an agentic session. This operation uses the agentic output resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemOutputsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemOutputsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemOutputsRequestBuilder when successful +func (m *AgenticSecuritySessionsItemOutputsRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemOutputsRequestBuilder { + return NewAgenticSecuritySessionsItemOutputsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_item_playbook_definition_request_builder.go b/security/agentic_security_sessions_item_playbook_definition_request_builder.go new file mode 100644 index 00000000000..df4f0708f45 --- /dev/null +++ b/security/agentic_security_sessions_item_playbook_definition_request_builder.go @@ -0,0 +1,91 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder provides operations to manage the playbookDefinition property of the microsoft.graph.investigationSession entity. +type AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetQueryParameters the required reference to an existing catalog definition, selected once by playbookDefinition@odata.bind on creation. Supports GET with $select. Deep insert, rebinding, $ref writes, and $expand aren't supported. +type AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetQueryParameters +} + +// NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderInternal instantiates a new AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder { + m := &AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions/{investigationSession%2Did}/playbookDefinition{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder instantiates a new AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get the required reference to an existing catalog definition, selected once by playbookDefinition@odata.bind on creation. Supports GET with $select. Deep insert, rebinding, $ref writes, and $expand aren't supported. +// returns a PlaybookDefinitionable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlaybookDefinitionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreatePlaybookDefinitionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlaybookDefinitionable), nil +} + +// ToGetRequestInformation the required reference to an existing catalog definition, selected once by playbookDefinition@odata.bind on creation. Supports GET with $select. Deep insert, rebinding, $ref writes, and $expand aren't supported. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder when successful +func (m *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder { + return NewAgenticSecuritySessionsItemPlaybookDefinitionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/agentic_security_sessions_request_builder.go b/security/agentic_security_sessions_request_builder.go new file mode 100644 index 00000000000..c43ad7b99da --- /dev/null +++ b/security/agentic_security_sessions_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// AgenticSecuritySessionsRequestBuilder provides operations to manage the sessions property of the microsoft.graph.agenticSecurityRoot entity. +type AgenticSecuritySessionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// AgenticSecuritySessionsRequestBuilderGetQueryParameters list the agentic sessions visible to the signed-in user. This operation uses the agentic session resource. +type AgenticSecuritySessionsRequestBuilderGetQueryParameters 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\"" +} + +// AgenticSecuritySessionsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *AgenticSecuritySessionsRequestBuilderGetQueryParameters +} + +// AgenticSecuritySessionsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type AgenticSecuritySessionsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByInvestigationSessionId provides operations to manage the sessions property of the microsoft.graph.agenticSecurityRoot entity. +// returns a *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder when successful +func (m *AgenticSecuritySessionsRequestBuilder) ByInvestigationSessionId(investigationSessionId string) *AgenticSecuritySessionsInvestigationSessionItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if investigationSessionId != "" { + urlTplParams["investigationSession%2Did"] = investigationSessionId + } + return NewAgenticSecuritySessionsInvestigationSessionItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewAgenticSecuritySessionsRequestBuilderInternal instantiates a new AgenticSecuritySessionsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsRequestBuilder { + m := &AgenticSecuritySessionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/agenticSecurity/sessions{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewAgenticSecuritySessionsRequestBuilder instantiates a new AgenticSecuritySessionsRequestBuilder and sets the default values. +func NewAgenticSecuritySessionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *AgenticSecuritySessionsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAgenticSecuritySessionsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get list the agentic sessions visible to the signed-in user. This operation uses the agentic session resource. +// returns a InvestigationSessionCollectionResponseable 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/agenticsecurityroot-list-sessions?view=graph-rest-beta +func (m *AgenticSecuritySessionsRequestBuilder) Get(ctx context.Context, requestConfiguration *AgenticSecuritySessionsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationSessionCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionCollectionResponseable), nil +} + +// Post create an agentic session to run an existing playbook against typed inputs. This operation uses the agentic session resource. +// returns a InvestigationSessionable 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/agenticsecurityroot-post-sessions?view=graph-rest-beta +func (m *AgenticSecuritySessionsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable, requestConfiguration *AgenticSecuritySessionsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateInvestigationSessionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable), nil +} + +// ToGetRequestInformation list the agentic sessions visible to the signed-in user. This operation uses the agentic session resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *AgenticSecuritySessionsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create an agentic session to run an existing playbook against typed inputs. This operation uses the agentic session resource. +// returns a *RequestInformation when successful +func (m *AgenticSecuritySessionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.InvestigationSessionable, requestConfiguration *AgenticSecuritySessionsRequestBuilderPostRequestConfiguration) (*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. +// returns a *AgenticSecuritySessionsRequestBuilder when successful +func (m *AgenticSecuritySessionsRequestBuilder) WithUrl(rawUrl string) *AgenticSecuritySessionsRequestBuilder { + return NewAgenticSecuritySessionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/b3af15a022eedc5dd2bce173461cce04915dde020257f556e52ce0e01fe9a547.go b/security/b3af15a022eedc5dd2bce173461cce04915dde020257f556e52ce0e01fe9a547.go new file mode 100644 index 00000000000..16e8455d578 --- /dev/null +++ b/security/b3af15a022eedc5dd2bce173461cce04915dde020257f556e52ce0e01fe9a547.go @@ -0,0 +1,82 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +// ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder provides operations to call the modify method. +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderInternal instantiates a new ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder and sets the default values. +func NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder { + m := &ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories/{contentManagementRepository%2Did}/microsoft.graph.security.contentManagement.modify", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder instantiates a new ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder and sets the default values. +func NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post modify a connected repository. +// returns a ContentManagementRepositoryable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder) Post(ctx context.Context, body ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderPostRequestConfiguration) (i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryable, 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, i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateContentManagementRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryable), nil +} + +// ToPostRequestInformation modify a connected repository. +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder) ToPostRequestInformation(ctx context.Context, body ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyModifyPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderPostRequestConfiguration) (*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. +// returns a *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder when successful +func (m *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder { + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/case_management_case_type_configurations_item_custom_fields_request_builder.go b/security/case_management_case_type_configurations_item_custom_fields_request_builder.go index be8c4850b0e..dce5597b8b0 100644 --- a/security/case_management_case_type_configurations_item_custom_fields_request_builder.go +++ b/security/case_management_case_type_configurations_item_custom_fields_request_builder.go @@ -15,7 +15,7 @@ type CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilderGetQueryParameters the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilderGetQueryParameters the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. type CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilder) Cou return NewCaseManagementCaseTypeConfigurationsItemCustomFieldsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// Get the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a CustomFieldDefinitionCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilder) Get(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilderGetRequestConfiguration) (i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.CustomFieldDefinitionCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilder) Get return res.(i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.CustomFieldDefinitionCollectionResponseable), nil } -// ToGetRequestInformation the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// ToGetRequestInformation the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a *RequestInformation when successful func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemCustomFieldsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/security/case_management_case_type_configurations_item_sla_policies_request_builder.go b/security/case_management_case_type_configurations_item_sla_policies_request_builder.go index bd00826dcae..1590b43d30e 100644 --- a/security/case_management_case_type_configurations_item_sla_policies_request_builder.go +++ b/security/case_management_case_type_configurations_item_sla_policies_request_builder.go @@ -15,7 +15,7 @@ type CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilderGetQueryParameters the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilderGetQueryParameters the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. type CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -87,7 +87,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilder) Coun return NewCaseManagementCaseTypeConfigurationsItemSlaPoliciesCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// Get the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. // returns a SlaPolicyDefinitionCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilder) Get(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilderGetRequestConfiguration) (i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.SlaPolicyDefinitionCollectionResponseable, error) { @@ -129,7 +129,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilder) Post return res.(i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.SlaPolicyDefinitionable), nil } -// ToGetRequestInformation the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, $skip, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. +// ToGetRequestInformation the contained SLA policy definitions configured for this case type. Supports $filter and $orderby on createdBy, createdDateTime, description, displayName, id, isActive, lastModifiedBy, and lastModifiedDateTime on the collection endpoint. For information about supported query parameters, see List slaPolicies. Also supports $count, $select, and $top on the collection endpoint. Supports $expand=slaPolicies when getting a case type configuration. // returns a *RequestInformation when successful func (m *CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemSlaPoliciesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/security/case_management_case_type_configurations_item_statuses_request_builder.go b/security/case_management_case_type_configurations_item_statuses_request_builder.go index 3b34497d65b..629a64ce20c 100644 --- a/security/case_management_case_type_configurations_item_statuses_request_builder.go +++ b/security/case_management_case_type_configurations_item_statuses_request_builder.go @@ -15,7 +15,7 @@ type CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilderGetQueryParameters the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilderGetQueryParameters the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. type CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilder) Count() return NewCaseManagementCaseTypeConfigurationsItemStatusesCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// Get the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a StatusDefinitionCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilder) Get(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilderGetRequestConfiguration) (i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.StatusDefinitionCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilder) Get(ctx return res.(i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.StatusDefinitionCollectionResponseable), nil } -// ToGetRequestInformation the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// ToGetRequestInformation the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a *RequestInformation when successful func (m *CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemStatusesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/security/case_management_case_type_configurations_item_statuses_status_definition_item_request_builder.go b/security/case_management_case_type_configurations_item_statuses_status_definition_item_request_builder.go index d5cda6e34d2..bff86d0c98a 100644 --- a/security/case_management_case_type_configurations_item_statuses_status_definition_item_request_builder.go +++ b/security/case_management_case_type_configurations_item_statuses_status_definition_item_request_builder.go @@ -15,7 +15,7 @@ type CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequest i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilderGetQueryParameters the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilderGetQueryParameters the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. type CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewCaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequ return NewCaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// Get the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a StatusDefinitionable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilderGetRequestConfiguration) (i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.StatusDefinitionable, error) { @@ -69,7 +69,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemReq return res.(i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.StatusDefinitionable), nil } -// ToGetRequestInformation the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// ToGetRequestInformation the contained top-level statuses that a case of this type can be set to. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a *RequestInformation when successful func (m *CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemStatusesStatusDefinitionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/security/content_management_repositories_content_management_repository_item_request_builder.go b/security/content_management_repositories_content_management_repository_item_request_builder.go new file mode 100644 index 00000000000..9156c6c6509 --- /dev/null +++ b/security/content_management_repositories_content_management_repository_item_request_builder.go @@ -0,0 +1,106 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +// ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder provides operations to manage the repositories property of the microsoft.graph.contentManagementRoot entity. +type ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetQueryParameters get a contentManagementRepository by its service-generated identifier. +type ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetQueryParameters +} + +// NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderInternal instantiates a new ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder and sets the default values. +func NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder { + m := &ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories/{contentManagementRepository%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder instantiates a new ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder and sets the default values. +func NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get a contentManagementRepository by its service-generated identifier. +// returns a ContentManagementRepositoryable 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/security-contentmanagement-contentmanagementrepository-get?view=graph-rest-beta +func (m *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetRequestConfiguration) (i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateContentManagementRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryable), nil +} + +// MicrosoftGraphSecurityContentManagementDisconnect provides operations to call the disconnect method. +// returns a *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder when successful +func (m *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder) MicrosoftGraphSecurityContentManagementDisconnect() *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilder { + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementDisconnectRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// MicrosoftGraphSecurityContentManagementModify provides operations to call the modify method. +// returns a *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder when successful +func (m *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder) MicrosoftGraphSecurityContentManagementModify() *ContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilder { + return NewContentManagementRepositoriesItemMicrosoftGraphSecurityContentManagementModifyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToGetRequestInformation get a contentManagementRepository by its service-generated identifier. +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder when successful +func (m *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder { + return NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/content_management_repositories_count_request_builder.go b/security/content_management_repositories_count_request_builder.go new file mode 100644 index 00000000000..f8705d7ea32 --- /dev/null +++ b/security/content_management_repositories_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ContentManagementRepositoriesCountRequestBuilder provides operations to count the resources in the collection. +type ContentManagementRepositoriesCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesCountRequestBuilderGetQueryParameters get the number of the resource +type ContentManagementRepositoriesCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ContentManagementRepositoriesCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ContentManagementRepositoriesCountRequestBuilderGetQueryParameters +} + +// NewContentManagementRepositoriesCountRequestBuilderInternal instantiates a new ContentManagementRepositoriesCountRequestBuilder and sets the default values. +func NewContentManagementRepositoriesCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesCountRequestBuilder { + m := &ContentManagementRepositoriesCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesCountRequestBuilder instantiates a new ContentManagementRepositoriesCountRequestBuilder and sets the default values. +func NewContentManagementRepositoriesCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ContentManagementRepositoriesCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentManagementRepositoriesCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentManagementRepositoriesCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ContentManagementRepositoriesCountRequestBuilder when successful +func (m *ContentManagementRepositoriesCountRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesCountRequestBuilder { + return NewContentManagementRepositoriesCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/content_management_repositories_microsoft_graph_security_content_management_connect_request_builder.go b/security/content_management_repositories_microsoft_graph_security_content_management_connect_request_builder.go new file mode 100644 index 00000000000..066f60c5625 --- /dev/null +++ b/security/content_management_repositories_microsoft_graph_security_content_management_connect_request_builder.go @@ -0,0 +1,82 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +// ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder provides operations to call the connect method. +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderInternal instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder { + m := &ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories/microsoft.graph.security.contentManagement.connect", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post connect a repository. +// returns a ContentManagementRepositoryable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder) Post(ctx context.Context, body ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderPostRequestConfiguration) (i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryable, 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, i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateContentManagementRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryable), nil +} + +// ToPostRequestInformation connect a repository. +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder) ToPostRequestInformation(ctx context.Context, body ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderPostRequestConfiguration) (*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. +// returns a *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/content_management_repositories_request_builder.go b/security/content_management_repositories_request_builder.go new file mode 100644 index 00000000000..15b22209ba7 --- /dev/null +++ b/security/content_management_repositories_request_builder.go @@ -0,0 +1,137 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +// ContentManagementRepositoriesRequestBuilder provides operations to manage the repositories property of the microsoft.graph.contentManagementRoot entity. +type ContentManagementRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesRequestBuilderGetQueryParameters list the contentManagementRepository connections in the tenant. An empty tenant returns an empty collection. +type ContentManagementRepositoriesRequestBuilderGetQueryParameters 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\"" +} + +// ContentManagementRepositoriesRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ContentManagementRepositoriesRequestBuilderGetQueryParameters +} + +// ByContentManagementRepositoryId provides operations to manage the repositories property of the microsoft.graph.contentManagementRoot entity. +// returns a *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder when successful +func (m *ContentManagementRepositoriesRequestBuilder) ByContentManagementRepositoryId(contentManagementRepositoryId string) *ContentManagementRepositoriesContentManagementRepositoryItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if contentManagementRepositoryId != "" { + urlTplParams["contentManagementRepository%2Did"] = contentManagementRepositoryId + } + return NewContentManagementRepositoriesContentManagementRepositoryItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewContentManagementRepositoriesRequestBuilderInternal instantiates a new ContentManagementRepositoriesRequestBuilder and sets the default values. +func NewContentManagementRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesRequestBuilder { + m := &ContentManagementRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesRequestBuilder instantiates a new ContentManagementRepositoriesRequestBuilder and sets the default values. +func NewContentManagementRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ContentManagementRepositoriesCountRequestBuilder when successful +func (m *ContentManagementRepositoriesRequestBuilder) Count() *ContentManagementRepositoriesCountRequestBuilder { + return NewContentManagementRepositoriesCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get list the contentManagementRepository connections in the tenant. An empty tenant returns an empty collection. +// returns a ContentManagementRepositoryCollectionResponseable 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/contentmanagementroot-list-repositories?view=graph-rest-beta +func (m *ContentManagementRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *ContentManagementRepositoriesRequestBuilderGetRequestConfiguration) (i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateContentManagementRepositoryCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ContentManagementRepositoryCollectionResponseable), nil +} + +// MicrosoftGraphSecurityContentManagementConnect provides operations to call the connect method. +// returns a *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder when successful +func (m *ContentManagementRepositoriesRequestBuilder) MicrosoftGraphSecurityContentManagementConnect() *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilder { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// MicrosoftGraphSecurityContentManagementDiscoverAvailableRepositories provides operations to call the discoverAvailableRepositories method. +// returns a *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder when successful +func (m *ContentManagementRepositoriesRequestBuilder) MicrosoftGraphSecurityContentManagementDiscoverAvailableRepositories() *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// ToGetRequestInformation list the contentManagementRepository connections in the tenant. An empty tenant returns an empty collection. +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ContentManagementRepositoriesRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ContentManagementRepositoriesRequestBuilder when successful +func (m *ContentManagementRepositoriesRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesRequestBuilder { + return NewContentManagementRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/content_management_request_builder.go b/security/content_management_request_builder.go new file mode 100644 index 00000000000..4fee8bb0e4c --- /dev/null +++ b/security/content_management_request_builder.go @@ -0,0 +1,34 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ContentManagementRequestBuilder builds and executes requests for operations under \security\contentManagement +type ContentManagementRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// NewContentManagementRequestBuilderInternal instantiates a new ContentManagementRequestBuilder and sets the default values. +func NewContentManagementRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRequestBuilder { + m := &ContentManagementRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement", pathParameters), + } + return m +} + +// NewContentManagementRequestBuilder instantiates a new ContentManagementRequestBuilder and sets the default values. +func NewContentManagementRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRequestBuilderInternal(urlParams, requestAdapter) +} + +// Repositories provides operations to manage the repositories property of the microsoft.graph.contentManagementRoot entity. +// returns a *ContentManagementRepositoriesRequestBuilder when successful +func (m *ContentManagementRequestBuilder) Repositories() *ContentManagementRepositoriesRequestBuilder { + return NewContentManagementRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/e642cb3b8a213ff1b62c74fe486a25b5e3f121e86b2b4491e0ee5fd9a8d7665c.go b/security/e642cb3b8a213ff1b62c74fe486a25b5e3f121e86b2b4491e0ee5fd9a8d7665c.go new file mode 100644 index 00000000000..aa3c07bead7 --- /dev/null +++ b/security/e642cb3b8a213ff1b62c74fe486a25b5e3f121e86b2b4491e0ee5fd9a8d7665c.go @@ -0,0 +1,407 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" + i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security/contentmanagement" +) + +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody() *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody { + m := &ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody(), nil +} + +// GetAccessCredential gets the accessCredential property value. Provider credential used to establish or refresh repository access. The concrete type(set via `@odata.type`) selects the credential style. All fields are input only and arenever returned. +// returns a RepositoryAccessCredentialable when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable { + val, err := m.GetBackingStore().Get("accessCredential") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + } + return nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetContentTypes gets the contentTypes property value. The contentTypes property +// returns a []RepositoryContentType when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetContentTypes() []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType { + val, err := m.GetBackingStore().Get("contentTypes") + if err != nil { + panic(err) + } + if val != nil { + return val.([]i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType) + } + return nil +} + +// GetDeploymentIdentity gets the deploymentIdentity property value. The deploymentIdentity property +// returns a DeploymentIdentityable when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetDeploymentIdentity() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable { + val, err := m.GetBackingStore().Get("deploymentIdentity") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable) + } + return nil +} + +// GetDeploymentScope gets the deploymentScope property value. The deploymentScope property +// returns a DeploymentScopeable when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetDeploymentScope() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable { + val, err := m.GetBackingStore().Get("deploymentScope") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable) + } + return nil +} + +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetDescription() *string { + val, err := m.GetBackingStore().Get("description") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetDisplayName gets the displayName property value. The displayName property +// returns a *string when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetDisplayName() *string { + val, err := m.GetBackingStore().Get("displayName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["accessCredential"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositoryAccessCredentialFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccessCredential(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable)) + } + return nil + } + res["contentTypes"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ParseRepositoryContentType) + if err != nil { + return err + } + if val != nil { + res := make([]i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType)) + } + } + m.SetContentTypes(res) + } + return nil + } + res["deploymentIdentity"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateDeploymentIdentityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentIdentity(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable)) + } + return nil + } + res["deploymentScope"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateDeploymentScopeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentScope(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable)) + } + return nil + } + res["description"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["displayName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["repoType"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.ParseRepositoryType) + if err != nil { + return err + } + if val != nil { + m.SetRepoType(val.(*i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType)) + } + return nil + } + res["sourceLocation"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.CreateRepositorySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSourceLocation(val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable)) + } + return nil + } + return res +} + +// GetRepoType gets the repoType property value. Source-control provider. +// returns a *RepositoryType when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetRepoType() *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType { + val, err := m.GetBackingStore().Get("repoType") + if err != nil { + panic(err) + } + if val != nil { + return val.(*i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType) + } + return nil +} + +// GetSourceLocation gets the sourceLocation property value. Repository location settings. +// returns a RepositorySettingsable when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) GetSourceLocation() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable { + val, err := m.GetBackingStore().Get("sourceLocation") + if err != nil { + panic(err) + } + if val != nil { + return val.(i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable) + } + return nil +} + +// Serialize serializes information the current object +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteObjectValue("accessCredential", m.GetAccessCredential()) + if err != nil { + return err + } + } + if m.GetContentTypes() != nil { + err := writer.WriteCollectionOfStringValues("contentTypes", i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.SerializeRepositoryContentType(m.GetContentTypes())) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deploymentIdentity", m.GetDeploymentIdentity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deploymentScope", m.GetDeploymentScope()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + if m.GetRepoType() != nil { + cast := (*m.GetRepoType()).String() + err := writer.WriteStringValue("repoType", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("sourceLocation", m.GetSourceLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAccessCredential sets the accessCredential property value. Provider credential used to establish or refresh repository access. The concrete type(set via `@odata.type`) selects the credential style. All fields are input only and arenever returned. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) { + err := m.GetBackingStore().Set("accessCredential", value) + if err != nil { + panic(err) + } +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetContentTypes sets the contentTypes property value. The contentTypes property +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetContentTypes(value []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType) { + err := m.GetBackingStore().Set("contentTypes", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentIdentity sets the deploymentIdentity property value. The deploymentIdentity property +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetDeploymentIdentity(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable) { + err := m.GetBackingStore().Set("deploymentIdentity", value) + if err != nil { + panic(err) + } +} + +// SetDeploymentScope sets the deploymentScope property value. The deploymentScope property +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetDeploymentScope(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable) { + err := m.GetBackingStore().Set("deploymentScope", value) + if err != nil { + panic(err) + } +} + +// SetDescription sets the description property value. The description property +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetDescription(value *string) { + err := m.GetBackingStore().Set("description", value) + if err != nil { + panic(err) + } +} + +// SetDisplayName sets the displayName property value. The displayName property +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetDisplayName(value *string) { + err := m.GetBackingStore().Set("displayName", value) + if err != nil { + panic(err) + } +} + +// SetRepoType sets the repoType property value. Source-control provider. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetRepoType(value *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType) { + err := m.GetBackingStore().Set("repoType", value) + if err != nil { + panic(err) + } +} + +// SetSourceLocation sets the sourceLocation property value. Repository location settings. +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBody) SetSourceLocation(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable) { + err := m.GetBackingStore().Set("sourceLocation", value) + if err != nil { + panic(err) + } +} + +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementConnectConnectPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessCredential() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetContentTypes() []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType + GetDeploymentIdentity() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable + GetDeploymentScope() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable + GetDescription() *string + GetDisplayName() *string + GetRepoType() *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType + GetSourceLocation() i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable + SetAccessCredential(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryAccessCredentialable) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetContentTypes(value []i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryContentType) + SetDeploymentIdentity(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentIdentityable) + SetDeploymentScope(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.DeploymentScopeable) + SetDescription(value *string) + SetDisplayName(value *string) + SetRepoType(value *i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositoryType) + SetSourceLocation(value i5882c65c8ac4cbfd7a21704106aab111b8ae83763df7e06bcdb2d4f91a89bb05.RepositorySettingsable) +} diff --git a/security/ec5635bf4926e00dc044277c62f9e59c14b94d3c3586ac73c3a3f7aac21dc19a.go b/security/ec5635bf4926e00dc044277c62f9e59c14b94d3c3586ac73c3a3f7aac21dc19a.go new file mode 100644 index 00000000000..73d233c6744 --- /dev/null +++ b/security/ec5635bf4926e00dc044277c62f9e59c14b94d3c3586ac73c3a3f7aac21dc19a.go @@ -0,0 +1,103 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package security + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder provides operations to call the discoverAvailableRepositories method. +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderInternal instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder { + m := &ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/security/contentManagement/repositories/microsoft.graph.security.contentManagement.discoverAvailableRepositories", pathParameters), + } + return m +} + +// NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder instantiates a new ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder and sets the default values. +func NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post discover candidate repositories the caller can connect, using a supplied provider credential.Credential is passed in the request body and is never returned; only repository metadata is.Results are transient, non-addressable discovery records: the backend exposes no stable id fora candidate repository (confirmed in source), so they are modeled as value objects, not entities.The result is a bounded set: the action returns up to 200 candidate repositories accessible to thesupplied credential. It is not paged. Paging is not offered because the credential is a write-onlyrequest-body value and an OData `@odata.nextLink` continuation is a GET that cannot carry it; thebound keeps the response size predictable. Callers who need a specific repository connect it directly. +// Deprecated: This method is obsolete. Use PostAsDiscoverAvailableRepositoriesPostResponse instead. +// returns a ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder) Post(ctx context.Context, body ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderPostRequestConfiguration) (ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseable, 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, CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesResponseable), nil +} + +// PostAsDiscoverAvailableRepositoriesPostResponse discover candidate repositories the caller can connect, using a supplied provider credential.Credential is passed in the request body and is never returned; only repository metadata is.Results are transient, non-addressable discovery records: the backend exposes no stable id fora candidate repository (confirmed in source), so they are modeled as value objects, not entities.The result is a bounded set: the action returns up to 200 candidate repositories accessible to thesupplied credential. It is not paged. Paging is not offered because the credential is a write-onlyrequest-body value and an OData `@odata.nextLink` continuation is a GET that cannot carry it; thebound keeps the response size predictable. Callers who need a specific repository connect it directly. +// returns a ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder) PostAsDiscoverAvailableRepositoriesPostResponse(ctx context.Context, body ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderPostRequestConfiguration) (ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable, 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, CreateContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostResponseable), nil +} + +// ToPostRequestInformation discover candidate repositories the caller can connect, using a supplied provider credential.Credential is passed in the request body and is never returned; only repository metadata is.Results are transient, non-addressable discovery records: the backend exposes no stable id fora candidate repository (confirmed in source), so they are modeled as value objects, not entities.The result is a bounded set: the action returns up to 200 candidate repositories accessible to thesupplied credential. It is not paged. Paging is not offered because the credential is a write-onlyrequest-body value and an OData `@odata.nextLink` continuation is a GET that cannot carry it; thebound keeps the response size predictable. Callers who need a specific repository connect it directly. +// returns a *RequestInformation when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesDiscoverAvailableRepositoriesPostRequestBodyable, requestConfiguration *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilderPostRequestConfiguration) (*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. +// returns a *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder when successful +func (m *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder) WithUrl(rawUrl string) *ContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder { + return NewContentManagementRepositoriesMicrosoftGraphSecurityContentManagementDiscoverAvailableRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/security/f7b74abd361637a83edf5f4e4b4b001955dae8e830784564e068700356c8ea59.go b/security/f7b74abd361637a83edf5f4e4b4b001955dae8e830784564e068700356c8ea59.go index 08fd1b33c40..afd59e5c8d9 100644 --- a/security/f7b74abd361637a83edf5f4e4b4b001955dae8e830784564e068700356c8ea59.go +++ b/security/f7b74abd361637a83edf5f4e4b4b001955dae8e830784564e068700356c8ea59.go @@ -15,7 +15,7 @@ type CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionIt i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilderGetQueryParameters the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilderGetQueryParameters the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. type CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewCaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitio return NewCaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// Get the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a CustomFieldDefinitionable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilder) Get(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilderGetRequestConfiguration) (i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.CustomFieldDefinitionable, error) { @@ -69,7 +69,7 @@ func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefiniti return res.(i750b9d71a9bf5f6c4275c76749e837bdafc4c29fba400a35892bce5f6331b4f9.CustomFieldDefinitionable), nil } -// ToGetRequestInformation the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, $skip, and $top. +// ToGetRequestInformation the contained custom-field definitions that make up the blank-form schema for this case type. Read-only. Supports $count, $expand, $filter, $orderby, $select, and $top. // returns a *RequestInformation when successful func (m *CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *CaseManagementCaseTypeConfigurationsItemCustomFieldsCustomFieldDefinitionItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/security/security_request_builder.go b/security/security_request_builder.go index f9d23e364a1..5642282df6c 100644 --- a/security/security_request_builder.go +++ b/security/security_request_builder.go @@ -41,6 +41,12 @@ type SecurityRequestBuilderPatchRequestConfiguration struct { Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } +// AgenticSecurity the agenticSecurity property +// returns a *AgenticSecurityRequestBuilder when successful +func (m *SecurityRequestBuilder) AgenticSecurity() *AgenticSecurityRequestBuilder { + return NewAgenticSecurityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // Alerts provides operations to manage the alerts property of the microsoft.graph.security entity. // returns a *AlertsRequestBuilder when successful func (m *SecurityRequestBuilder) Alerts() *AlertsRequestBuilder { @@ -104,6 +110,12 @@ func NewSecurityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26337 return NewSecurityRequestBuilderInternal(urlParams, requestAdapter) } +// ContentManagement the contentManagement property +// returns a *ContentManagementRequestBuilder when successful +func (m *SecurityRequestBuilder) ContentManagement() *ContentManagementRequestBuilder { + return NewContentManagementRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // DataDiscovery provides operations to manage the dataDiscovery property of the microsoft.graph.security entity. // returns a *DataDiscoveryRequestBuilder when successful func (m *SecurityRequestBuilder) DataDiscovery() *DataDiscoveryRequestBuilder { diff --git a/serviceprincipals/item_restore_request_builder.go b/serviceprincipals/item_restore_request_builder.go index a38a2f4e2c5..412ffe32903 100644 --- a/serviceprincipals/item_restore_request_builder.go +++ b/serviceprincipals/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/solutions/1054127fa9d8ed5f7babc84fce8139042fa92aed0b6324bd78ee749254ecc070.go b/solutions/1054127fa9d8ed5f7babc84fce8139042fa92aed0b6324bd78ee749254ecc070.go index 19986775801..cc8e566b6a6 100644 --- a/solutions/1054127fa9d8ed5f7babc84fce8139042fa92aed0b6324bd78ee749254ecc070.go +++ b/solutions/1054127fa9d8ed5f7babc84fce8139042fa92aed0b6324bd78ee749254ecc070.go @@ -132,7 +132,7 @@ func (m *BackupRestoreOneDriveForBusinessProtectionPoliciesOneDriveForBusinessPr return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.OneDriveForBusinessProtectionPolicyable), nil } -// Patch update the protection policy for the OneDrive service in Microsoft 365. This method adds a driveProtectionUnit to or removes it from a oneDriveForBusinessProtectionPolicy object. +// Patch update the protection policy for the OneDrive service in Microsoft 365. This method updates retention settings or adds a driveProtectionUnit to or removes it from a oneDriveForBusinessProtectionPolicy object. // returns a OneDriveForBusinessProtectionPolicyable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -183,7 +183,7 @@ func (m *BackupRestoreOneDriveForBusinessProtectionPoliciesOneDriveForBusinessPr return requestInfo, nil } -// ToPatchRequestInformation update the protection policy for the OneDrive service in Microsoft 365. This method adds a driveProtectionUnit to or removes it from a oneDriveForBusinessProtectionPolicy object. +// ToPatchRequestInformation update the protection policy for the OneDrive service in Microsoft 365. This method updates retention settings or adds a driveProtectionUnit to or removes it from a oneDriveForBusinessProtectionPolicy object. // returns a *RequestInformation when successful func (m *BackupRestoreOneDriveForBusinessProtectionPoliciesOneDriveForBusinessProtectionPolicyItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.OneDriveForBusinessProtectionPolicyable, requestConfiguration *BackupRestoreOneDriveForBusinessProtectionPoliciesOneDriveForBusinessProtectionPolicyItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/solutions/backup_restore_exchange_protection_policies_exchange_protection_policy_item_request_builder.go b/solutions/backup_restore_exchange_protection_policies_exchange_protection_policy_item_request_builder.go index e562ad0620e..a68c7903e12 100644 --- a/solutions/backup_restore_exchange_protection_policies_exchange_protection_policy_item_request_builder.go +++ b/solutions/backup_restore_exchange_protection_policies_exchange_protection_policy_item_request_builder.go @@ -132,7 +132,7 @@ func (m *BackupRestoreExchangeProtectionPoliciesExchangeProtectionPolicyItemRequ return NewBackupRestoreExchangeProtectionPoliciesItemMailboxProtectionUnitsBulkAdditionJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Patch update an Exchange protection policy. This method adds a mailboxprotectionunit to or removes it from the protection policy. +// Patch update an Exchange protection policy. This method updates retention settings or adds a mailboxProtectionUnit to or removes it from the protection policy. // returns a ExchangeProtectionPolicyable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -183,7 +183,7 @@ func (m *BackupRestoreExchangeProtectionPoliciesExchangeProtectionPolicyItemRequ return requestInfo, nil } -// ToPatchRequestInformation update an Exchange protection policy. This method adds a mailboxprotectionunit to or removes it from the protection policy. +// ToPatchRequestInformation update an Exchange protection policy. This method updates retention settings or adds a mailboxProtectionUnit to or removes it from the protection policy. // returns a *RequestInformation when successful func (m *BackupRestoreExchangeProtectionPoliciesExchangeProtectionPolicyItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.ExchangeProtectionPolicyable, requestConfiguration *BackupRestoreExchangeProtectionPoliciesExchangeProtectionPolicyItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/solutions/backup_restore_share_point_protection_policies_share_point_protection_policy_item_request_builder.go b/solutions/backup_restore_share_point_protection_policies_share_point_protection_policy_item_request_builder.go index 585d12618f2..243b92d0c1f 100644 --- a/solutions/backup_restore_share_point_protection_policies_share_point_protection_policy_item_request_builder.go +++ b/solutions/backup_restore_share_point_protection_policies_share_point_protection_policy_item_request_builder.go @@ -102,7 +102,7 @@ func (m *BackupRestoreSharePointProtectionPoliciesSharePointProtectionPolicyItem return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.SharePointProtectionPolicyable), nil } -// Patch update a SharePoint protection policy. This method adds a siteprotectionunit to or removes it from the protection policy. +// Patch update a SharePoint protection policy. This method updates retention settings or adds a siteProtectionUnit to or removes it from the protection policy. // returns a SharePointProtectionPolicyable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -183,7 +183,7 @@ func (m *BackupRestoreSharePointProtectionPoliciesSharePointProtectionPolicyItem return requestInfo, nil } -// ToPatchRequestInformation update a SharePoint protection policy. This method adds a siteprotectionunit to or removes it from the protection policy. +// ToPatchRequestInformation update a SharePoint protection policy. This method updates retention settings or adds a siteProtectionUnit to or removes it from the protection policy. // returns a *RequestInformation when successful func (m *BackupRestoreSharePointProtectionPoliciesSharePointProtectionPolicyItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.SharePointProtectionPolicyable, requestConfiguration *BackupRestoreSharePointProtectionPoliciesSharePointProtectionPolicyItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teams/item_channels_channel_item_request_builder.go b/teams/item_channels_channel_item_request_builder.go index 25b043437d2..719bfb1a215 100644 --- a/teams/item_channels_channel_item_request_builder.go +++ b/teams/item_channels_channel_item_request_builder.go @@ -222,6 +222,12 @@ func (m *ItemChannelsChannelItemRequestBuilder) Tabs() *ItemChannelsItemTabsRequ return NewItemChannelsItemTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemChannelsItemTagsRequestBuilder when successful +func (m *ItemChannelsChannelItemRequestBuilder) Tags() *ItemChannelsItemTagsRequestBuilder { + return NewItemChannelsItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete the channel. // returns a *RequestInformation when successful func (m *ItemChannelsChannelItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsChannelItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teams/item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go b/teams/item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go index 9b64df285dc..38d038a5628 100644 --- a/teams/item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/teams/item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder(rawUrl string, req return NewItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context. return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teams/item_channels_item_planner_request_builder.go b/teams/item_channels_item_planner_request_builder.go index 3c66bb4cf69..407249df9f9 100644 --- a/teams/item_channels_item_planner_request_builder.go +++ b/teams/item_channels_item_planner_request_builder.go @@ -64,11 +64,8 @@ func NewItemChannelsItemPlannerRequestBuilder(rawUrl string, requestAdapter i2ae return NewItemChannelsItemPlannerRequestBuilderInternal(urlParams, requestAdapter) } -// Delete delete a teamsChannelPlanner object. +// Delete delete navigation property planner for teams // 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/channel-delete-planner?view=graph-rest-beta func (m *ItemChannelsItemPlannerRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemChannelsItemPlannerRequestBuilderDeleteRequestConfiguration) error { requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) if err != nil { @@ -108,12 +105,9 @@ func (m *ItemChannelsItemPlannerRequestBuilder) Get(ctx context.Context, request return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamsChannelPlannerable), nil } -// Patch update the properties of a teamsChannelPlanner object. +// Patch update the navigation property planner in teams // returns a TeamsChannelPlannerable 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/teamschannelplanner-update?view=graph-rest-beta func (m *ItemChannelsItemPlannerRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamsChannelPlannerable, requestConfiguration *ItemChannelsItemPlannerRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamsChannelPlannerable, error) { requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) if err != nil { @@ -144,7 +138,7 @@ func (m *ItemChannelsItemPlannerRequestBuilder) Plans_v2() *ItemChannelsItemPlan return NewItemChannelsItemPlannerPlans_v2RequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// ToDeleteRequestInformation delete a teamsChannelPlanner object. +// ToDeleteRequestInformation delete navigation property planner for teams // returns a *RequestInformation when successful func (m *ItemChannelsItemPlannerRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemPlannerRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) @@ -171,7 +165,7 @@ func (m *ItemChannelsItemPlannerRequestBuilder) ToGetRequestInformation(ctx cont return requestInfo, nil } -// ToPatchRequestInformation update the properties of a teamsChannelPlanner object. +// ToPatchRequestInformation update the navigation property planner in teams // returns a *RequestInformation when successful func (m *ItemChannelsItemPlannerRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamsChannelPlannerable, requestConfiguration *ItemChannelsItemPlannerRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teams/item_channels_item_tags_count_request_builder.go b/teams/item_channels_item_tags_count_request_builder.go new file mode 100644 index 00000000000..642e5235157 --- /dev/null +++ b/teams/item_channels_item_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemChannelsItemTagsCountRequestBuilder provides operations to count the resources in the collection. +type ItemChannelsItemTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemChannelsItemTagsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemChannelsItemTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemChannelsItemTagsCountRequestBuilderGetQueryParameters +} + +// NewItemChannelsItemTagsCountRequestBuilderInternal instantiates a new ItemChannelsItemTagsCountRequestBuilder and sets the default values. +func NewItemChannelsItemTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsCountRequestBuilder { + m := &ItemChannelsItemTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/channels/{channel%2Did}/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemChannelsItemTagsCountRequestBuilder instantiates a new ItemChannelsItemTagsCountRequestBuilder and sets the default values. +func NewItemChannelsItemTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemChannelsItemTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemChannelsItemTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemChannelsItemTagsCountRequestBuilder when successful +func (m *ItemChannelsItemTagsCountRequestBuilder) WithUrl(rawUrl string) *ItemChannelsItemTagsCountRequestBuilder { + return NewItemChannelsItemTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_channels_item_tags_item_members_count_request_builder.go b/teams/item_channels_item_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..b4a933dd85f --- /dev/null +++ b/teams/item_channels_item_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemChannelsItemTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type ItemChannelsItemTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type ItemChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewItemChannelsItemTagsItemMembersCountRequestBuilderInternal instantiates a new ItemChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemChannelsItemTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsItemMembersCountRequestBuilder { + m := &ItemChannelsItemTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemChannelsItemTagsItemMembersCountRequestBuilder instantiates a new ItemChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemChannelsItemTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemChannelsItemTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemChannelsItemTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *ItemChannelsItemTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *ItemChannelsItemTagsItemMembersCountRequestBuilder { + return NewItemChannelsItemTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_channels_item_tags_item_members_request_builder.go b/teams/item_channels_item_tags_item_members_request_builder.go new file mode 100644 index 00000000000..120877f8c4d --- /dev/null +++ b/teams/item_channels_item_tags_item_members_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemChannelsItemTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemChannelsItemTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemChannelsItemTagsItemMembersRequestBuilderGetQueryParameters get the teamworkTagMember objects assigned to a teamworkChannelTag owned by the specified channel. +type ItemChannelsItemTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// ItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemChannelsItemTagsItemMembersRequestBuilderGetQueryParameters +} + +// ItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemChannelsItemTagsItemMembersRequestBuilderInternal instantiates a new ItemChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewItemChannelsItemTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsItemMembersRequestBuilder { + m := &ItemChannelsItemTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemChannelsItemTagsItemMembersRequestBuilder instantiates a new ItemChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewItemChannelsItemTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemChannelsItemTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) Count() *ItemChannelsItemTagsItemMembersCountRequestBuilder { + return NewItemChannelsItemTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get the teamworkTagMember objects assigned to a teamworkChannelTag owned by the specified channel. +// returns a TeamworkTagMemberCollectionResponseable 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/teamworkchanneltag-list-members?view=graph-rest-beta +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create a teamworkTagMember object, which assigns a user to a teamworkChannelTag owned by the specified channel. A tag can have up to 200 members. +// returns a TeamworkTagMemberable 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/teamworkchanneltag-post-members?view=graph-rest-beta +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation get the teamworkTagMember objects assigned to a teamworkChannelTag owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create a teamworkTagMember object, which assigns a user to a teamworkChannelTag owned by the specified channel. A tag can have up to 200 members. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemChannelsItemTagsItemMembersRequestBuilder when successful +func (m *ItemChannelsItemTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *ItemChannelsItemTagsItemMembersRequestBuilder { + return NewItemChannelsItemTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go b/teams/item_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..ca8d547d45d --- /dev/null +++ b/teams/item_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters get a teamworkTagMember of a teamworkChannelTag owned by the specified channel. +type ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete a teamworkTagMember from a teamworkChannelTag owned by the specified channel. +// 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/teamworkchanneltag-delete-members?view=graph-rest-beta +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get a teamworkTagMember of a teamworkChannelTag owned by the specified channel. +// returns a TeamworkTagMemberable 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/teamworkchanneltag-get-members?view=graph-rest-beta +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teams +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete a teamworkTagMember from a teamworkChannelTag owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get a teamworkTagMember of a teamworkChannelTag owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teams +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *ItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_channels_item_tags_request_builder.go b/teams/item_channels_item_tags_request_builder.go new file mode 100644 index 00000000000..7e1494b2487 --- /dev/null +++ b/teams/item_channels_item_tags_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemChannelsItemTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemChannelsItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemChannelsItemTagsRequestBuilderGetQueryParameters get a list of the teamworkChannelTag objects owned by the specified channel. +type ItemChannelsItemTagsRequestBuilderGetQueryParameters 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\"" +} + +// ItemChannelsItemTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemChannelsItemTagsRequestBuilderGetQueryParameters +} + +// ItemChannelsItemTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemChannelsItemTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemChannelsItemTagsRequestBuilderInternal instantiates a new ItemChannelsItemTagsRequestBuilder and sets the default values. +func NewItemChannelsItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsRequestBuilder { + m := &ItemChannelsItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/channels/{channel%2Did}/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemChannelsItemTagsRequestBuilder instantiates a new ItemChannelsItemTagsRequestBuilder and sets the default values. +func NewItemChannelsItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemChannelsItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemChannelsItemTagsCountRequestBuilder when successful +func (m *ItemChannelsItemTagsRequestBuilder) Count() *ItemChannelsItemTagsCountRequestBuilder { + return NewItemChannelsItemTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get get a list of the teamworkChannelTag objects owned by the specified channel. +// returns a TeamworkChannelTagCollectionResponseable 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/channel-list-tags?view=graph-rest-beta +func (m *ItemChannelsItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create a teamworkChannelTag owned by a channel and assign its initial members. The General channel doesn't support the creation of channel-owned tags; use the Create teamworkTag instead. +// returns a TeamworkChannelTagable 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/channel-post-tags?view=graph-rest-beta +func (m *ItemChannelsItemTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemChannelsItemTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation get a list of the teamworkChannelTag objects owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create a teamworkChannelTag owned by a channel and assign its initial members. The General channel doesn't support the creation of channel-owned tags; use the Create teamworkTag instead. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemChannelsItemTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemChannelsItemTagsRequestBuilder when successful +func (m *ItemChannelsItemTagsRequestBuilder) WithUrl(rawUrl string) *ItemChannelsItemTagsRequestBuilder { + return NewItemChannelsItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_channels_item_tags_teamwork_channel_tag_item_request_builder.go b/teams/item_channels_item_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..b5ec0f36067 --- /dev/null +++ b/teams/item_channels_item_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,188 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters get the properties of a teamworkChannelTag owned by the specified channel. +type ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + m := &ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder instantiates a new ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete a teamworkChannelTag owned by the specified channel. +// 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/teamworkchanneltag-delete?view=graph-rest-beta +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get get the properties of a teamworkChannelTag owned by the specified channel. +// returns a TeamworkChannelTagable 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/teamworkchanneltag-get?view=graph-rest-beta +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemChannelsItemTagsItemMembersRequestBuilder when successful +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Members() *ItemChannelsItemTagsItemMembersRequestBuilder { + return NewItemChannelsItemTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the display name or description of a teamworkChannelTag owned by the specified channel. +// returns a TeamworkChannelTagable 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/teamworkchanneltag-update?view=graph-rest-beta +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete a teamworkChannelTag owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation get the properties of a teamworkChannelTag owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the display name or description of a teamworkChannelTag owned by the specified channel. +// returns a *RequestInformation when successful +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *ItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + return NewItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go b/teams/item_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go index 74eeecfcdf8..a92bdf0ea0c 100644 --- a/teams/item_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/teams/item_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder(rawUrl string, r return NewItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) Get(ctx contex return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teams/item_primary_channel_planner_plans_escaped_v2_request_builder.go b/teams/item_primary_channel_planner_plans_escaped_v2_request_builder.go index 09a23608484..695d133a83c 100644 --- a/teams/item_primary_channel_planner_plans_escaped_v2_request_builder.go +++ b/teams/item_primary_channel_planner_plans_escaped_v2_request_builder.go @@ -15,7 +15,7 @@ type ItemPrimaryChannelPlannerPlans_v2RequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *ItemPrimaryChannelPlannerPlans_v2RequestBuilder) Count() *ItemPrimaryCh return NewItemPrimaryChannelPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *ItemPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx context.Contex return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemPrimaryChannelPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teams/item_primary_channel_request_builder.go b/teams/item_primary_channel_request_builder.go index 78cf3bcb9d9..27d4db87ecd 100644 --- a/teams/item_primary_channel_request_builder.go +++ b/teams/item_primary_channel_request_builder.go @@ -216,6 +216,12 @@ func (m *ItemPrimaryChannelRequestBuilder) Tabs() *ItemPrimaryChannelTabsRequest return NewItemPrimaryChannelTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemPrimaryChannelTagsRequestBuilder when successful +func (m *ItemPrimaryChannelRequestBuilder) Tags() *ItemPrimaryChannelTagsRequestBuilder { + return NewItemPrimaryChannelTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property primaryChannel for teams // returns a *RequestInformation when successful func (m *ItemPrimaryChannelRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teams/item_primary_channel_tags_count_request_builder.go b/teams/item_primary_channel_tags_count_request_builder.go new file mode 100644 index 00000000000..a36a72f20f9 --- /dev/null +++ b/teams/item_primary_channel_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemPrimaryChannelTagsCountRequestBuilder provides operations to count the resources in the collection. +type ItemPrimaryChannelTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemPrimaryChannelTagsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemPrimaryChannelTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPrimaryChannelTagsCountRequestBuilderGetQueryParameters +} + +// NewItemPrimaryChannelTagsCountRequestBuilderInternal instantiates a new ItemPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsCountRequestBuilder { + m := &ItemPrimaryChannelTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/primaryChannel/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemPrimaryChannelTagsCountRequestBuilder instantiates a new ItemPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrimaryChannelTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemPrimaryChannelTagsCountRequestBuilder when successful +func (m *ItemPrimaryChannelTagsCountRequestBuilder) WithUrl(rawUrl string) *ItemPrimaryChannelTagsCountRequestBuilder { + return NewItemPrimaryChannelTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_primary_channel_tags_item_members_count_request_builder.go b/teams/item_primary_channel_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..62439fbe973 --- /dev/null +++ b/teams/item_primary_channel_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemPrimaryChannelTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type ItemPrimaryChannelTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewItemPrimaryChannelTagsItemMembersCountRequestBuilderInternal instantiates a new ItemPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsItemMembersCountRequestBuilder { + m := &ItemPrimaryChannelTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/primaryChannel/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemPrimaryChannelTagsItemMembersCountRequestBuilder instantiates a new ItemPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrimaryChannelTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *ItemPrimaryChannelTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *ItemPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewItemPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_primary_channel_tags_item_members_request_builder.go b/teams/item_primary_channel_tags_item_members_request_builder.go new file mode 100644 index 00000000000..bccab433f24 --- /dev/null +++ b/teams/item_primary_channel_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemPrimaryChannelTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemPrimaryChannelTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type ItemPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// ItemPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters +} + +// ItemPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemPrimaryChannelTagsItemMembersRequestBuilderInternal instantiates a new ItemPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsItemMembersRequestBuilder { + m := &ItemPrimaryChannelTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/primaryChannel/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemPrimaryChannelTagsItemMembersRequestBuilder instantiates a new ItemPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrimaryChannelTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) Count() *ItemPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewItemPrimaryChannelTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for teams +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for teams +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *ItemPrimaryChannelTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *ItemPrimaryChannelTagsItemMembersRequestBuilder { + return NewItemPrimaryChannelTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go b/teams/item_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..d7810797654 --- /dev/null +++ b/teams/item_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/primaryChannel/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for teams +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teams +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for teams +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teams +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *ItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewItemPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_primary_channel_tags_request_builder.go b/teams/item_primary_channel_tags_request_builder.go new file mode 100644 index 00000000000..45ea6ec5f38 --- /dev/null +++ b/teams/item_primary_channel_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemPrimaryChannelTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemPrimaryChannelTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemPrimaryChannelTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemPrimaryChannelTagsRequestBuilderGetQueryParameters 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\"" +} + +// ItemPrimaryChannelTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPrimaryChannelTagsRequestBuilderGetQueryParameters +} + +// ItemPrimaryChannelTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemPrimaryChannelTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemPrimaryChannelTagsRequestBuilderInternal instantiates a new ItemPrimaryChannelTagsRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsRequestBuilder { + m := &ItemPrimaryChannelTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/primaryChannel/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemPrimaryChannelTagsRequestBuilder instantiates a new ItemPrimaryChannelTagsRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrimaryChannelTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemPrimaryChannelTagsCountRequestBuilder when successful +func (m *ItemPrimaryChannelTagsRequestBuilder) Count() *ItemPrimaryChannelTagsCountRequestBuilder { + return NewItemPrimaryChannelTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for teams +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for teams +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemPrimaryChannelTagsRequestBuilder when successful +func (m *ItemPrimaryChannelTagsRequestBuilder) WithUrl(rawUrl string) *ItemPrimaryChannelTagsRequestBuilder { + return NewItemPrimaryChannelTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teams/item_primary_channel_tags_teamwork_channel_tag_item_request_builder.go b/teams/item_primary_channel_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..6e2be25aac6 --- /dev/null +++ b/teams/item_primary_channel_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + m := &ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team%2Did}/primaryChannel/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder instantiates a new ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for teams +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Members() *ItemPrimaryChannelTagsItemMembersRequestBuilder { + return NewItemPrimaryChannelTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in teams +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for teams +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in teams +// returns a *RequestInformation when successful +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *ItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + return NewItemPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_channels_channel_item_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_channel_item_request_builder.go index 002e5f7cd5e..0011b3b2324 100644 --- a/teamtemplatedefinition/item_team_definition_channels_channel_item_request_builder.go +++ b/teamtemplatedefinition/item_team_definition_channels_channel_item_request_builder.go @@ -213,6 +213,12 @@ func (m *ItemTeamDefinitionChannelsChannelItemRequestBuilder) Tabs() *ItemTeamDe return NewItemTeamDefinitionChannelsItemTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamDefinitionChannelsItemTagsRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsChannelItemRequestBuilder) Tags() *ItemTeamDefinitionChannelsItemTagsRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property channels for teamTemplateDefinition // returns a *RequestInformation when successful func (m *ItemTeamDefinitionChannelsChannelItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsChannelItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go index fb30946789b..77cd1430814 100644 --- a/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder struct i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder(rawU return NewItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Ge return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_request_builder.go index 4f20e13024c..a36d7ceccfb 100644 --- a/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_request_builder.go +++ b/teamtemplatedefinition/item_team_definition_channels_item_planner_plans_escaped_v2_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder) Count() *I return NewItemTeamDefinitionChannelsItemPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx co return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamtemplatedefinition/item_team_definition_channels_item_tags_count_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_tags_count_request_builder.go new file mode 100644 index 00000000000..ffe8fca5da6 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_channels_item_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionChannelsItemTagsCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamDefinitionChannelsItemTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetQueryParameters +} + +// NewItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal instantiates a new ItemTeamDefinitionChannelsItemTagsCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + m := &ItemTeamDefinitionChannelsItemTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionChannelsItemTagsCountRequestBuilder instantiates a new ItemTeamDefinitionChannelsItemTagsCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_count_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..0cf4d6fc6ea --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal instantiates a new ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + m := &ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder instantiates a new ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_request_builder.go new file mode 100644 index 00000000000..ebb13bbc391 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal instantiates a new ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + m := &ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder instantiates a new ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) Count() *ItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for teamTemplateDefinition +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..5a34fde4334 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for teamTemplateDefinition +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teamTemplateDefinition +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_channels_item_tags_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_tags_request_builder.go new file mode 100644 index 00000000000..e127795c6e3 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_channels_item_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionChannelsItemTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamDefinitionChannelsItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionChannelsItemTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamDefinitionChannelsItemTagsRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionChannelsItemTagsRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamDefinitionChannelsItemTagsRequestBuilderInternal instantiates a new ItemTeamDefinitionChannelsItemTagsRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsRequestBuilder { + m := &ItemTeamDefinitionChannelsItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionChannelsItemTagsRequestBuilder instantiates a new ItemTeamDefinitionChannelsItemTagsRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionChannelsItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) Count() *ItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for teamTemplateDefinition +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamDefinitionChannelsItemTagsRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionChannelsItemTagsRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_channels_item_tags_teamwork_channel_tag_item_request_builder.go b/teamtemplatedefinition/item_team_definition_channels_item_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..7d79f213adb --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_channels_item_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + m := &ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder instantiates a new ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for teamTemplateDefinition +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Members() *ItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in teamTemplateDefinition +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + return NewItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go index edc04669548..36d5a729f8a 100644 --- a/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder struc i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder(ra return NewItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_request_builder.go index 34eb31a9a9e..9e1c774f5c6 100644 --- a/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_request_builder.go +++ b/teamtemplatedefinition/item_team_definition_primary_channel_planner_plans_escaped_v2_request_builder.go @@ -15,7 +15,7 @@ type ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder) Count() return NewItemTeamDefinitionPrimaryChannelPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_request_builder.go index 7701990d046..50a0b582368 100644 --- a/teamtemplatedefinition/item_team_definition_primary_channel_request_builder.go +++ b/teamtemplatedefinition/item_team_definition_primary_channel_request_builder.go @@ -213,6 +213,12 @@ func (m *ItemTeamDefinitionPrimaryChannelRequestBuilder) Tabs() *ItemTeamDefinit return NewItemTeamDefinitionPrimaryChannelTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelRequestBuilder) Tags() *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property primaryChannel for teamTemplateDefinition // returns a *RequestInformation when successful func (m *ItemTeamDefinitionPrimaryChannelRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_tags_count_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_tags_count_request_builder.go new file mode 100644 index 00000000000..15188b90f7c --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_primary_channel_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetQueryParameters +} + +// NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal instantiates a new ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + m := &ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder instantiates a new ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_count_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..96ee4e54d00 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal instantiates a new ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + m := &ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder instantiates a new ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_request_builder.go new file mode 100644 index 00000000000..5021082877e --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal instantiates a new ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + m := &ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder instantiates a new ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) Count() *ItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for teamTemplateDefinition +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..e4c11b83c04 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_primary_channel_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for teamTemplateDefinition +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teamTemplateDefinition +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_tags_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_tags_request_builder.go new file mode 100644 index 00000000000..0cd9514bdd1 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_primary_channel_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionPrimaryChannelTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamDefinitionPrimaryChannelTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetQueryParameters 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\"" +} + +// ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal instantiates a new ItemTeamDefinitionPrimaryChannelTagsRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + m := &ItemTeamDefinitionPrimaryChannelTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionPrimaryChannelTagsRequestBuilder instantiates a new ItemTeamDefinitionPrimaryChannelTagsRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) Count() *ItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for teamTemplateDefinition +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamtemplatedefinition/item_team_definition_primary_channel_tags_teamwork_channel_tag_item_request_builder.go b/teamtemplatedefinition/item_team_definition_primary_channel_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..421a0495f62 --- /dev/null +++ b/teamtemplatedefinition/item_team_definition_primary_channel_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamtemplatedefinition + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + m := &ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamTemplateDefinition/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder instantiates a new ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for teamTemplateDefinition +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Members() *ItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in teamTemplateDefinition +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in teamTemplateDefinition +// returns a *RequestInformation when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *ItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + return NewItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/091c40f452539d859b4e4ef155528064798e4a69e44edacc6a606405bfe60585.go b/teamwork/091c40f452539d859b4e4ef155528064798e4a69e44edacc6a606405bfe60585.go new file mode 100644 index 00000000000..a514389a762 --- /dev/null +++ b/teamwork/091c40f452539d859b4e4ef155528064798e4a69e44edacc6a606405bfe60585.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for teamwork +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teamwork +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/0c7deadce573bb224e6bcc10ddc2cc79634acb77fa831e148101f1665c1f8120.go b/teamwork/0c7deadce573bb224e6bcc10ddc2cc79634acb77fa831e148101f1665c1f8120.go index 8599cbe9484..52e0d1e3c79 100644 --- a/teamwork/0c7deadce573bb224e6bcc10ddc2cc79634acb77fa831e148101f1665c1f8120.go +++ b/teamwork/0c7deadce573bb224e6bcc10ddc2cc79634acb77fa831e148101f1665c1f8120.go @@ -15,7 +15,7 @@ type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2Pl i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_ return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamwork/3c2b4b6919e410798e3d9a0353c40b75799e11fcc5f50cf0a85c3368e8c37514.go b/teamwork/3c2b4b6919e410798e3d9a0353c40b75799e11fcc5f50cf0a85c3368e8c37514.go new file mode 100644 index 00000000000..4e9a8ddaf2f --- /dev/null +++ b/teamwork/3c2b4b6919e410798e3d9a0353c40b75799e11fcc5f50cf0a85c3368e8c37514.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) Count() *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for teamwork +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/4645e549fdc708d251ea0f8868a064f292e5973ff37b9ee9bbe805efc97b5380.go b/teamwork/4645e549fdc708d251ea0f8868a064f292e5973ff37b9ee9bbe805efc97b5380.go index 3c291e95a18..a9042870441 100644 --- a/teamwork/4645e549fdc708d251ea0f8868a064f292e5973ff37b9ee9bbe805efc97b5380.go +++ b/teamwork/4645e549fdc708d251ea0f8868a064f292e5973ff37b9ee9bbe805efc97b5380.go @@ -15,7 +15,7 @@ type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2 i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlan return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlan return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamwork/6c59644ad4a09222f1be79055f0f815dd3250b52cfab470c55d22c218864b6e5.go b/teamwork/6c59644ad4a09222f1be79055f0f815dd3250b52cfab470c55d22c218864b6e5.go new file mode 100644 index 00000000000..3c45a22f86f --- /dev/null +++ b/teamwork/6c59644ad4a09222f1be79055f0f815dd3250b52cfab470c55d22c218864b6e5.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/7a0a0d3375ab76da2c0ca50479427e7d2da2d1363de7fd8120dc836e4c37834b.go b/teamwork/7a0a0d3375ab76da2c0ca50479427e7d2da2d1363de7fd8120dc836e4c37834b.go new file mode 100644 index 00000000000..242d5d8fcce --- /dev/null +++ b/teamwork/7a0a0d3375ab76da2c0ca50479427e7d2da2d1363de7fd8120dc836e4c37834b.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for teamwork +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Members() *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in teamwork +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/826abeb931d3b13366144adba4b5518b0d3285addff99d9ef53cc89e7eaeb46a.go b/teamwork/826abeb931d3b13366144adba4b5518b0d3285addff99d9ef53cc89e7eaeb46a.go index 62937d7ccc6..c3f0ef3d170 100644 --- a/teamwork/826abeb931d3b13366144adba4b5518b0d3285addff99d9ef53cc89e7eaeb46a.go +++ b/teamwork/826abeb931d3b13366144adba4b5518b0d3285addff99d9ef53cc89e7eaeb46a.go @@ -15,7 +15,7 @@ type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2Re i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_ return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_ return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamwork/a95fa5a6e8ad204731744694f6b6913e6f90f623a78288a455c82ff696bdeb7f.go b/teamwork/a95fa5a6e8ad204731744694f6b6913e6f90f623a78288a455c82ff696bdeb7f.go new file mode 100644 index 00000000000..954c44ae0e2 --- /dev/null +++ b/teamwork/a95fa5a6e8ad204731744694f6b6913e6f90f623a78288a455c82ff696bdeb7f.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/bac717cb8a588afe78a76cda4ac7703a877b493c6a78c76fed0a5dfc6a33df53.go b/teamwork/bac717cb8a588afe78a76cda4ac7703a877b493c6a78c76fed0a5dfc6a33df53.go new file mode 100644 index 00000000000..c6774a282fb --- /dev/null +++ b/teamwork/bac717cb8a588afe78a76cda4ac7703a877b493c6a78c76fed0a5dfc6a33df53.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for teamwork +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Members() *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in teamwork +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/d27c34417b0684fc53a3aa36a883f99609f337b3df13cbabd0146a8f5874ea2c.go b/teamwork/d27c34417b0684fc53a3aa36a883f99609f337b3df13cbabd0146a8f5874ea2c.go new file mode 100644 index 00000000000..e8cec3694d2 --- /dev/null +++ b/teamwork/d27c34417b0684fc53a3aa36a883f99609f337b3df13cbabd0146a8f5874ea2c.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for teamwork +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teamwork +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/d6d268b6d39a79e207433d383929525bcfa130817f617d8b961a6b6f499fb451.go b/teamwork/d6d268b6d39a79e207433d383929525bcfa130817f617d8b961a6b6f499fb451.go index c3423ec0b79..ec4f53b99a4 100644 --- a/teamwork/d6d268b6d39a79e207433d383929525bcfa130817f617d8b961a6b6f499fb451.go +++ b/teamwork/d6d268b6d39a79e207433d383929525bcfa130817f617d8b961a6b6f499fb451.go @@ -15,7 +15,7 @@ type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2 i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlan return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamwork/deleted_teams_item_channels_channel_item_request_builder.go b/teamwork/deleted_teams_item_channels_channel_item_request_builder.go index ec3ec82f4ea..e6bd9aa3fb7 100644 --- a/teamwork/deleted_teams_item_channels_channel_item_request_builder.go +++ b/teamwork/deleted_teams_item_channels_channel_item_request_builder.go @@ -213,6 +213,12 @@ func (m *DeletedTeamsItemChannelsChannelItemRequestBuilder) Tabs() *DeletedTeams return NewDeletedTeamsItemChannelsItemTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *DeletedTeamsItemChannelsItemTagsRequestBuilder when successful +func (m *DeletedTeamsItemChannelsChannelItemRequestBuilder) Tags() *DeletedTeamsItemChannelsItemTagsRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property channels for teamwork // returns a *RequestInformation when successful func (m *DeletedTeamsItemChannelsChannelItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsChannelItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go b/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go index e1f21d00bbe..d8d0a57d0d9 100644 --- a/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewDeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder(rawUrl return NewDeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder) Get( return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_request_builder.go b/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_request_builder.go index a35e1188df5..b62edd12157 100644 --- a/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_request_builder.go +++ b/teamwork/deleted_teams_item_channels_item_planner_plans_escaped_v2_request_builder.go @@ -15,7 +15,7 @@ type DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. type DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilderGetQueryParameters struct { // Include count of items Count *bool "uriparametername:\"%24count\"" @@ -79,7 +79,7 @@ func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilder) Count() *Del return NewDeletedTeamsItemChannelsItemPlannerPlans_v2CountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a PlanCollectionResponseable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable, error) { @@ -100,7 +100,7 @@ func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilder) Get(ctx cont return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.PlanCollectionResponseable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans owned by the Teams channel. Currently, only shared channels are supported. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API owned by the Teams channel. Currently, only shared channels are supported. // returns a *RequestInformation when successful func (m *DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemPlannerPlans_v2RequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/teamwork/deleted_teams_item_channels_item_tags_count_request_builder.go b/teamwork/deleted_teams_item_channels_item_tags_count_request_builder.go new file mode 100644 index 00000000000..a626ac4e069 --- /dev/null +++ b/teamwork/deleted_teams_item_channels_item_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// DeletedTeamsItemChannelsItemTagsCountRequestBuilder provides operations to count the resources in the collection. +type DeletedTeamsItemChannelsItemTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetQueryParameters get the number of the resource +type DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetQueryParameters +} + +// NewDeletedTeamsItemChannelsItemTagsCountRequestBuilderInternal instantiates a new DeletedTeamsItemChannelsItemTagsCountRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsCountRequestBuilder { + m := &DeletedTeamsItemChannelsItemTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/deletedTeams/{deletedTeam%2Did}/channels/{channel%2Did}/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewDeletedTeamsItemChannelsItemTagsCountRequestBuilder instantiates a new DeletedTeamsItemChannelsItemTagsCountRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDeletedTeamsItemChannelsItemTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *DeletedTeamsItemChannelsItemTagsCountRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsCountRequestBuilder) WithUrl(rawUrl string) *DeletedTeamsItemChannelsItemTagsCountRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/deleted_teams_item_channels_item_tags_item_members_count_request_builder.go b/teamwork/deleted_teams_item_channels_item_tags_item_members_count_request_builder.go new file mode 100644 index 00000000000..0dc9397f2c0 --- /dev/null +++ b/teamwork/deleted_teams_item_channels_item_tags_item_members_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder provides operations to count the resources in the collection. +type DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters get the number of the resource +type DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetQueryParameters +} + +// NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderInternal instantiates a new DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder { + m := &DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/deletedTeams/{deletedTeam%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder instantiates a new DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder) WithUrl(rawUrl string) *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/deleted_teams_item_channels_item_tags_item_members_request_builder.go b/teamwork/deleted_teams_item_channels_item_tags_item_members_request_builder.go new file mode 100644 index 00000000000..21530964025 --- /dev/null +++ b/teamwork/deleted_teams_item_channels_item_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetQueryParameters +} + +// DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderInternal instantiates a new DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder { + m := &DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/deletedTeams/{deletedTeam%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder instantiates a new DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) Count() *DeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for teamwork +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for teamwork +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/deleted_teams_item_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go b/teamwork/deleted_teams_item_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go new file mode 100644 index 00000000000..9db83f95426 --- /dev/null +++ b/teamwork/deleted_teams_item_channels_item_tags_item_members_teamwork_tag_member_item_request_builder.go @@ -0,0 +1,173 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters users assigned to the tag. +type DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetQueryParameters +} + +// DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal instantiates a new DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + m := &DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/deletedTeams/{deletedTeam%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members/{teamworkTagMember%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder instantiates a new DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property members for teamwork +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// Patch update the navigation property members in teamwork +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToDeleteRequestInformation delete navigation property members for teamwork +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property members in teamwork +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder) WithUrl(rawUrl string) *DeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/deleted_teams_item_channels_item_tags_request_builder.go b/teamwork/deleted_teams_item_channels_item_tags_request_builder.go new file mode 100644 index 00000000000..1df487ecfb1 --- /dev/null +++ b/teamwork/deleted_teams_item_channels_item_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// DeletedTeamsItemChannelsItemTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type DeletedTeamsItemChannelsItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// DeletedTeamsItemChannelsItemTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type DeletedTeamsItemChannelsItemTagsRequestBuilderGetQueryParameters 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\"" +} + +// DeletedTeamsItemChannelsItemTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *DeletedTeamsItemChannelsItemTagsRequestBuilderGetQueryParameters +} + +// DeletedTeamsItemChannelsItemTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewDeletedTeamsItemChannelsItemTagsRequestBuilderInternal instantiates a new DeletedTeamsItemChannelsItemTagsRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsRequestBuilder { + m := &DeletedTeamsItemChannelsItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/deletedTeams/{deletedTeam%2Did}/channels/{channel%2Did}/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewDeletedTeamsItemChannelsItemTagsRequestBuilder instantiates a new DeletedTeamsItemChannelsItemTagsRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDeletedTeamsItemChannelsItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *DeletedTeamsItemChannelsItemTagsCountRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) Count() *DeletedTeamsItemChannelsItemTagsCountRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for teamwork +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *DeletedTeamsItemChannelsItemTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for teamwork +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *DeletedTeamsItemChannelsItemTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *DeletedTeamsItemChannelsItemTagsRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsRequestBuilder) WithUrl(rawUrl string) *DeletedTeamsItemChannelsItemTagsRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/deleted_teams_item_channels_item_tags_teamwork_channel_tag_item_request_builder.go b/teamwork/deleted_teams_item_channels_item_tags_teamwork_channel_tag_item_request_builder.go new file mode 100644 index 00000000000..c0a970110f5 --- /dev/null +++ b/teamwork/deleted_teams_item_channels_item_tags_teamwork_channel_tag_item_request_builder.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters the tags owned by the channel. +type DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetQueryParameters +} + +// DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal instantiates a new DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + m := &DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/deletedTeams/{deletedTeam%2Did}/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder instantiates a new DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder and sets the default values. +func NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete delete navigation property tags for teamwork +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// Members provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Members() *DeletedTeamsItemChannelsItemTagsItemMembersRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Patch update the navigation property tags in teamwork +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToDeleteRequestInformation delete navigation property tags for teamwork +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property tags in teamwork +// returns a *RequestInformation when successful +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder) WithUrl(rawUrl string) *DeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + return NewDeletedTeamsItemChannelsItemTagsTeamworkChannelTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/team_templates_item_definitions_item_team_definition_channels_channel_item_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_channels_channel_item_request_builder.go index 0734dd514da..abc2f8dbbe9 100644 --- a/teamwork/team_templates_item_definitions_item_team_definition_channels_channel_item_request_builder.go +++ b/teamwork/team_templates_item_definitions_item_team_definition_channels_channel_item_request_builder.go @@ -213,6 +213,12 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsChannelItemReques return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsChannelItemRequestBuilder) Tags() *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property channels for teamwork // returns a *RequestInformation when successful func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsChannelItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsChannelItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_count_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_count_request_builder.go new file mode 100644 index 00000000000..f2b20c71a06 --- /dev/null +++ b/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder provides operations to count the resources in the collection. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetQueryParameters get the number of the resource +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetQueryParameters +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_item_members_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_item_members_request_builder.go new file mode 100644 index 00000000000..7bd4067d60a --- /dev/null +++ b/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_item_members_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetQueryParameters users assigned to the tag. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetQueryParameters 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\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkTagMemberId provides operations to manage the members property of the microsoft.graph.teamworkTag entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) ByTeamworkTagMemberId(teamworkTagMemberId string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkTagMemberId != "" { + urlTplParams["teamworkTagMember%2Did"] = teamworkTagMemberId + } + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersTeamworkTagMemberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags/{teamworkChannelTag%2Did}/members{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) Count() *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get users assigned to the tag. +// returns a TeamworkTagMemberCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberCollectionResponseable), nil +} + +// Post create new navigation property to members for teamwork +// returns a TeamworkTagMemberable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkTagMemberFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable), nil +} + +// ToGetRequestInformation users assigned to the tag. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to members for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkTagMemberable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilderPostRequestConfiguration) (*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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_request_builder.go new file mode 100644 index 00000000000..04af90400a2 --- /dev/null +++ b/teamwork/team_templates_item_definitions_item_team_definition_channels_item_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetQueryParameters 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\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/channels/{channel%2Did}/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) Count() *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for teamwork +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionChannelsItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_request_builder.go index f9072b9d480..db40043a6c0 100644 --- a/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_request_builder.go +++ b/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_request_builder.go @@ -213,6 +213,12 @@ func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelRequestBuil return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTabsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// Tags provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelRequestBuilder) Tags() *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // ToDeleteRequestInformation delete navigation property primaryChannel for teamwork // returns a *RequestInformation when successful func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { diff --git a/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_tags_count_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_tags_count_request_builder.go new file mode 100644 index 00000000000..6519afa63c8 --- /dev/null +++ b/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_tags_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder provides operations to count the resources in the collection. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetQueryParameters get the number of the resource +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetQueryParameters +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_tags_request_builder.go b/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_tags_request_builder.go new file mode 100644 index 00000000000..abcba9931df --- /dev/null +++ b/teamwork/team_templates_item_definitions_item_team_definition_primary_channel_tags_request_builder.go @@ -0,0 +1,167 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package teamwork + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder provides operations to manage the tags property of the microsoft.graph.channel entity. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetQueryParameters the tags owned by the channel. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetQueryParameters 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\"" +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetQueryParameters +} + +// TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByTeamworkChannelTagId provides operations to manage the tags property of the microsoft.graph.channel entity. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) ByTeamworkChannelTagId(teamworkChannelTagId string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if teamworkChannelTagId != "" { + urlTplParams["teamworkChannelTag%2Did"] = teamworkChannelTagId + } + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsTeamworkChannelTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + m := &TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teamwork/teamTemplates/{teamTemplate%2Did}/definitions/{teamTemplateDefinition%2Did}/teamDefinition/primaryChannel/tags{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder instantiates a new TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder and sets the default values. +func NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) Count() *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the tags owned by the channel. +// returns a TeamworkChannelTagCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagCollectionResponseable), nil +} + +// Post create new navigation property to tags for teamwork +// returns a TeamworkChannelTagable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateTeamworkChannelTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable), nil +} + +// ToGetRequestInformation the tags owned by the channel. +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation create new navigation property to tags for teamwork +// returns a *RequestInformation when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkChannelTagable, requestConfiguration *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilderPostRequestConfiguration) (*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. +// returns a *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder when successful +func (m *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder) WithUrl(rawUrl string) *TeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder { + return NewTeamTemplatesItemDefinitionsItemTeamDefinitionPrimaryChannelTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/5b4deaf68765c26283d2e67d581a237bef2f04bb97356728739e5a908115126d.go b/users/5b4deaf68765c26283d2e67d581a237bef2f04bb97356728739e5a908115126d.go new file mode 100644 index 00000000000..1d595a9b24c --- /dev/null +++ b/users/5b4deaf68765c26283d2e67d581a237bef2f04bb97356728739e5a908115126d.go @@ -0,0 +1,179 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder provides operations to manage the verificationEvents property of the microsoft.graph.identityVerificationStatus entity. +type ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderDeleteRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderDeleteRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetQueryParameters the user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +type ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetQueryParameters +} + +// ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderInternal instantiates a new ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder { + m := &ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/identityVerificationStatus/verificationEvents/{identityVerificationEvent%2Did}{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder instantiates a new ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderInternal(urlParams, requestAdapter) +} + +// Delete remove an identityVerificationEvent record from a user's verification history. The service recomputes the user's aggregate verification status after removing the event. This operation removes the record for administrative cleanup; it doesn't change sign-in access controls. +// 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/identityverificationevent-delete?view=graph-rest-beta +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderDeleteRequestConfiguration) error { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// Get the user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +// returns a IdentityVerificationEventable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateIdentityVerificationEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable), nil +} + +// Patch apply or update the administrative override reason on an identityVerificationEvent. Only overrideDetails.reason can be updated. The service sets actorType, actorId, and overriddenDateTime from the caller's identity on each successful update. This operation doesn't change the verification facts, lifecycle state, or the user's aggregate verification status. +// returns a IdentityVerificationEventable 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/identityverificationevent-update?view=graph-rest-beta +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateIdentityVerificationEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable), nil +} + +// ToDeleteRequestInformation remove an identityVerificationEvent record from a user's verification history. The service recomputes the user's aggregate verification status after removing the event. This operation removes the record for administrative cleanup; it doesn't change sign-in access controls. +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderDeleteRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToGetRequestInformation the user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation apply or update the administrative override reason on an identityVerificationEvent. Only overrideDetails.reason can be updated. The service sets actorType, actorId, and overriddenDateTime from the caller's identity on each successful update. This operation doesn't change the verification facts, lifecycle state, or the user's aggregate verification status. +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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. +// returns a *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder when successful +func (m *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder) WithUrl(rawUrl string) *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder { + return NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_authentication_methods_authentication_method_item_request_builder.go b/users/item_authentication_methods_authentication_method_item_request_builder.go index 774174d9df1..4d17cf960c9 100644 --- a/users/item_authentication_methods_authentication_method_item_request_builder.go +++ b/users/item_authentication_methods_authentication_method_item_request_builder.go @@ -41,6 +41,12 @@ type ItemAuthenticationMethodsAuthenticationMethodItemRequestBuilderPatchRequest Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption } +// AttestProvenance provides operations to call the attestProvenance method. +// returns a *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder when successful +func (m *ItemAuthenticationMethodsAuthenticationMethodItemRequestBuilder) AttestProvenance() *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder { + return NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // NewItemAuthenticationMethodsAuthenticationMethodItemRequestBuilderInternal instantiates a new ItemAuthenticationMethodsAuthenticationMethodItemRequestBuilder and sets the default values. func NewItemAuthenticationMethodsAuthenticationMethodItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemAuthenticationMethodsAuthenticationMethodItemRequestBuilder { m := &ItemAuthenticationMethodsAuthenticationMethodItemRequestBuilder{ diff --git a/users/item_authentication_methods_item_attest_provenance_post_request_body.go b/users/item_authentication_methods_item_attest_provenance_post_request_body.go new file mode 100644 index 00000000000..0d0f5bf28e1 --- /dev/null +++ b/users/item_authentication_methods_item_attest_provenance_post_request_body.go @@ -0,0 +1,165 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ItemAuthenticationMethodsItemAttestProvenancePostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewItemAuthenticationMethodsItemAttestProvenancePostRequestBody instantiates a new ItemAuthenticationMethodsItemAttestProvenancePostRequestBody and sets the default values. +func NewItemAuthenticationMethodsItemAttestProvenancePostRequestBody() *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody { + m := &ItemAuthenticationMethodsItemAttestProvenancePostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateItemAuthenticationMethodsItemAttestProvenancePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemAuthenticationMethodsItemAttestProvenancePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemAuthenticationMethodsItemAttestProvenancePostRequestBody(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetAttestationReason gets the attestationReason property value. The attestationReason property +// returns a *string when successful +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) GetAttestationReason() *string { + val, err := m.GetBackingStore().Get("attestationReason") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["attestationReason"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAttestationReason(val) + } + return nil + } + res["verificationEventId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVerificationEventId(val) + } + return nil + } + return res +} + +// GetVerificationEventId gets the verificationEventId property value. The verificationEventId property +// returns a *string when successful +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) GetVerificationEventId() *string { + val, err := m.GetBackingStore().Get("verificationEventId") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// Serialize serializes information the current object +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("attestationReason", m.GetAttestationReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("verificationEventId", m.GetVerificationEventId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetAttestationReason sets the attestationReason property value. The attestationReason property +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) SetAttestationReason(value *string) { + err := m.GetBackingStore().Set("attestationReason", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetVerificationEventId sets the verificationEventId property value. The verificationEventId property +func (m *ItemAuthenticationMethodsItemAttestProvenancePostRequestBody) SetVerificationEventId(value *string) { + err := m.GetBackingStore().Set("verificationEventId", value) + if err != nil { + panic(err) + } +} + +type ItemAuthenticationMethodsItemAttestProvenancePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAttestationReason() *string + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetVerificationEventId() *string + SetAttestationReason(value *string) + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetVerificationEventId(value *string) +} diff --git a/users/item_authentication_methods_item_attest_provenance_request_builder.go b/users/item_authentication_methods_item_attest_provenance_request_builder.go new file mode 100644 index 00000000000..10e185ba076 --- /dev/null +++ b/users/item_authentication_methods_item_attest_provenance_request_builder.go @@ -0,0 +1,82 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder provides operations to call the attestProvenance method. +type ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemAuthenticationMethodsItemAttestProvenanceRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemAuthenticationMethodsItemAttestProvenanceRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilderInternal instantiates a new ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder and sets the default values. +func NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder { + m := &ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/authentication/methods/{authenticationMethod%2Did}/attestProvenance", pathParameters), + } + return m +} + +// NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilder instantiates a new ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder and sets the default values. +func NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post apply an administrative attestation to the credential provenance of an authenticationMethod. Credential provenance is currently supported for FIDO2 authentication methods. Classification, actor information, and timestamps are managed by the service and aren't request parameters. +// returns a CredentialProvenanceable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder) Post(ctx context.Context, body ItemAuthenticationMethodsItemAttestProvenancePostRequestBodyable, requestConfiguration *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CredentialProvenanceable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateCredentialProvenanceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CredentialProvenanceable), nil +} + +// ToPostRequestInformation apply an administrative attestation to the credential provenance of an authenticationMethod. Credential provenance is currently supported for FIDO2 authentication methods. Classification, actor information, and timestamps are managed by the service and aren't request parameters. +// returns a *RequestInformation when successful +func (m *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemAuthenticationMethodsItemAttestProvenancePostRequestBodyable, requestConfiguration *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder when successful +func (m *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder) WithUrl(rawUrl string) *ItemAuthenticationMethodsItemAttestProvenanceRequestBuilder { + return NewItemAuthenticationMethodsItemAttestProvenanceRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_cloud_p_cs_cloud_p_c_item_request_builder.go b/users/item_cloud_p_cs_cloud_p_c_item_request_builder.go index 20f3db197aa..0c8eed5034c 100644 --- a/users/item_cloud_p_cs_cloud_p_c_item_request_builder.go +++ b/users/item_cloud_p_cs_cloud_p_c_item_request_builder.go @@ -225,6 +225,18 @@ func (m *ItemCloudPCsCloudPCItemRequestBuilder) RetrieveCloudPCRemoteActionResul return NewItemCloudPCsItemRetrieveCloudPCRemoteActionResultsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// RetrieveFlexCloudPcAccessConfiguration provides operations to call the retrieveFlexCloudPcAccessConfiguration method. +// returns a *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder when successful +func (m *ItemCloudPCsCloudPCItemRequestBuilder) RetrieveFlexCloudPcAccessConfiguration() *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + return NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// RetrieveFlexCloudPcConfigurationDetail provides operations to call the retrieveFlexCloudPcConfigurationDetail method. +// returns a *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder when successful +func (m *ItemCloudPCsCloudPCItemRequestBuilder) RetrieveFlexCloudPcConfigurationDetail() *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + return NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // RetrieveFrontlineCloudPcDetail provides operations to call the retrieveFrontlineCloudPcDetail method. // returns a *ItemCloudPCsItemRetrieveFrontlineCloudPcDetailRequestBuilder when successful func (m *ItemCloudPCsCloudPCItemRequestBuilder) RetrieveFrontlineCloudPcDetail() *ItemCloudPCsItemRetrieveFrontlineCloudPcDetailRequestBuilder { @@ -249,6 +261,12 @@ func (m *ItemCloudPCsCloudPCItemRequestBuilder) RetryPartnerAgentInstallation() return NewItemCloudPCsItemRetryPartnerAgentInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// SetDeviceName provides operations to call the setDeviceName method. +// returns a *ItemCloudPCsItemSetDeviceNameRequestBuilder when successful +func (m *ItemCloudPCsCloudPCItemRequestBuilder) SetDeviceName() *ItemCloudPCsItemSetDeviceNameRequestBuilder { + return NewItemCloudPCsItemSetDeviceNameRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // SetReviewStatus provides operations to call the setReviewStatus method. // returns a *ItemCloudPCsItemSetReviewStatusRequestBuilder when successful func (m *ItemCloudPCsCloudPCItemRequestBuilder) SetReviewStatus() *ItemCloudPCsItemSetReviewStatusRequestBuilder { diff --git a/users/item_cloud_p_cs_item_retrieve_flex_cloud_pc_access_configuration_request_builder.go b/users/item_cloud_p_cs_item_retrieve_flex_cloud_pc_access_configuration_request_builder.go new file mode 100644 index 00000000000..abd0371ab37 --- /dev/null +++ b/users/item_cloud_p_cs_item_retrieve_flex_cloud_pc_access_configuration_request_builder.go @@ -0,0 +1,81 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder provides operations to call the retrieveFlexCloudPcAccessConfiguration method. +type ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal instantiates a new ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder and sets the default values. +func NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + m := &ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/cloudPCs/{cloudPC%2Did}/retrieveFlexCloudPcAccessConfiguration()", pathParameters), + } + return m +} + +// NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder instantiates a new ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder and sets the default values. +func NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the current access configuration of a Windows 365 Flex (formerly Windows 365 Frontline) Cloud PC. The cloudPcFlexAccessConfiguration response contains the live accessState of the Cloud PC. Use the /me endpoint to retrieve the access configuration of a Cloud PC that belongs to the signed-in user. An administrator or application can use the /deviceManagement/virtualEndpoint endpoint to retrieve the access configuration of a targeted Cloud PC. +// returns a CloudPcFlexAccessConfigurationable 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/cloudpc-retrieveflexcloudpcaccessconfiguration?view=graph-rest-beta +func (m *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexAccessConfigurationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateCloudPcFlexAccessConfigurationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexAccessConfigurationable), nil +} + +// ToGetRequestInformation get the current access configuration of a Windows 365 Flex (formerly Windows 365 Frontline) Cloud PC. The cloudPcFlexAccessConfiguration response contains the live accessState of the Cloud PC. Use the /me endpoint to retrieve the access configuration of a Cloud PC that belongs to the signed-in user. An administrator or application can use the /deviceManagement/virtualEndpoint endpoint to retrieve the access configuration of a targeted Cloud PC. +// returns a *RequestInformation when successful +func (m *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder when successful +func (m *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder) WithUrl(rawUrl string) *ItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder { + return NewItemCloudPCsItemRetrieveFlexCloudPcAccessConfigurationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_cloud_p_cs_item_retrieve_flex_cloud_pc_configuration_detail_request_builder.go b/users/item_cloud_p_cs_item_retrieve_flex_cloud_pc_configuration_detail_request_builder.go new file mode 100644 index 00000000000..cb86112b603 --- /dev/null +++ b/users/item_cloud_p_cs_item_retrieve_flex_cloud_pc_configuration_detail_request_builder.go @@ -0,0 +1,81 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder provides operations to call the retrieveFlexCloudPcConfigurationDetail method. +type ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal instantiates a new ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder and sets the default values. +func NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + m := &ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/cloudPCs/{cloudPC%2Did}/retrieveFlexCloudPcConfigurationDetail()", pathParameters), + } + return m +} + +// NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder instantiates a new ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder and sets the default values. +func NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get Windows 365 Flex (formerly Windows 365 Frontline) configuration details for a Cloud PC, including license availability. The cloudPcFlexConfigurationDetail response indicates whether a Flex license is available, based on the service plan and concurrent-access group for the Cloud PC. This function retrieves license availability, not the power state of the Cloud PC. To retrieve its live access state, use retrieveFlexCloudPcAccessConfiguration. +// returns a CloudPcFlexConfigurationDetailable 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/cloudpc-retrieveflexcloudpcconfigurationdetail?view=graph-rest-beta +func (m *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexConfigurationDetailable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateCloudPcFlexConfigurationDetailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CloudPcFlexConfigurationDetailable), nil +} + +// ToGetRequestInformation get Windows 365 Flex (formerly Windows 365 Frontline) configuration details for a Cloud PC, including license availability. The cloudPcFlexConfigurationDetail response indicates whether a Flex license is available, based on the service plan and concurrent-access group for the Cloud PC. This function retrieves license availability, not the power state of the Cloud PC. To retrieve its live access state, use retrieveFlexCloudPcAccessConfiguration. +// returns a *RequestInformation when successful +func (m *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + 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. +// returns a *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder when successful +func (m *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder) WithUrl(rawUrl string) *ItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder { + return NewItemCloudPCsItemRetrieveFlexCloudPcConfigurationDetailRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_cloud_p_cs_item_set_device_name_post_request_body.go b/users/item_cloud_p_cs_item_set_device_name_post_request_body.go new file mode 100644 index 00000000000..0ad7f8cdb02 --- /dev/null +++ b/users/item_cloud_p_cs_item_set_device_name_post_request_body.go @@ -0,0 +1,126 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e "github.com/microsoft/kiota-abstractions-go/store" +) + +type ItemCloudPCsItemSetDeviceNamePostRequestBody struct { + // Stores model information. + backingStore ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore +} + +// NewItemCloudPCsItemSetDeviceNamePostRequestBody instantiates a new ItemCloudPCsItemSetDeviceNamePostRequestBody and sets the default values. +func NewItemCloudPCsItemSetDeviceNamePostRequestBody() *ItemCloudPCsItemSetDeviceNamePostRequestBody { + m := &ItemCloudPCsItemSetDeviceNamePostRequestBody{} + m.backingStore = ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStoreFactoryInstance() + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateItemCloudPCsItemSetDeviceNamePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCloudPCsItemSetDeviceNamePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCloudPCsItemSetDeviceNamePostRequestBody(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) GetAdditionalData() map[string]any { + val, err := m.backingStore.Get("additionalData") + if err != nil { + panic(err) + } + if val == nil { + var value = make(map[string]any) + m.SetAdditionalData(value) + } + return val.(map[string]any) +} + +// GetBackingStore gets the BackingStore property value. Stores model information. +// returns a BackingStore when successful +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore { + return m.backingStore +} + +// GetDeviceName gets the deviceName property value. The deviceName property +// returns a *string when successful +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) GetDeviceName() *string { + val, err := m.GetBackingStore().Get("deviceName") + if err != nil { + panic(err) + } + if val != nil { + return val.(*string) + } + return nil +} + +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error when successful +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["deviceName"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeviceName(val) + } + return nil + } + return res +} + +// Serialize serializes information the current object +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("deviceName", m.GetDeviceName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) SetAdditionalData(value map[string]any) { + err := m.GetBackingStore().Set("additionalData", value) + if err != nil { + panic(err) + } +} + +// SetBackingStore sets the BackingStore property value. Stores model information. +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) { + m.backingStore = value +} + +// SetDeviceName sets the deviceName property value. The deviceName property +func (m *ItemCloudPCsItemSetDeviceNamePostRequestBody) SetDeviceName(value *string) { + err := m.GetBackingStore().Set("deviceName", value) + if err != nil { + panic(err) + } +} + +type ItemCloudPCsItemSetDeviceNamePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackedModel + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBackingStore() ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore + GetDeviceName() *string + SetBackingStore(value ie8677ce2c7e1b4c22e9c3827ecd078d41185424dd9eeb92b7d971ed2d49a392e.BackingStore) + SetDeviceName(value *string) +} diff --git a/users/item_cloud_p_cs_item_set_device_name_request_builder.go b/users/item_cloud_p_cs_item_set_device_name_request_builder.go new file mode 100644 index 00000000000..b9f66ffe71f --- /dev/null +++ b/users/item_cloud_p_cs_item_set_device_name_request_builder.go @@ -0,0 +1,80 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemCloudPCsItemSetDeviceNameRequestBuilder provides operations to call the setDeviceName method. +type ItemCloudPCsItemSetDeviceNameRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemCloudPCsItemSetDeviceNameRequestBuilderInternal instantiates a new ItemCloudPCsItemSetDeviceNameRequestBuilder and sets the default values. +func NewItemCloudPCsItemSetDeviceNameRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemCloudPCsItemSetDeviceNameRequestBuilder { + m := &ItemCloudPCsItemSetDeviceNameRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/cloudPCs/{cloudPC%2Did}/setDeviceName", pathParameters), + } + return m +} + +// NewItemCloudPCsItemSetDeviceNameRequestBuilder instantiates a new ItemCloudPCsItemSetDeviceNameRequestBuilder and sets the default values. +func NewItemCloudPCsItemSetDeviceNameRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemCloudPCsItemSetDeviceNameRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCloudPCsItemSetDeviceNameRequestBuilderInternal(urlParams, requestAdapter) +} + +// Post set the operating system device name of a Cloud PC. This action runs asynchronously and changes the computer name, not the displayName property. To change the display name, use rename. This action supports Windows 365 Enterprise and Windows 365 Flex (formerly Frontline) Cloud PCs in dedicated mode. Use getSupportedCloudPcRemoteActions to check whether the action is available for a Cloud PC. +// 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/cloudpc-setdevicename?view=graph-rest-beta +func (m *ItemCloudPCsItemSetDeviceNameRequestBuilder) Post(ctx context.Context, body ItemCloudPCsItemSetDeviceNamePostRequestBodyable, requestConfiguration *ItemCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration) error { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} + +// ToPostRequestInformation set the operating system device name of a Cloud PC. This action runs asynchronously and changes the computer name, not the displayName property. To change the display name, use rename. This action supports Windows 365 Enterprise and Windows 365 Flex (formerly Frontline) Cloud PCs in dedicated mode. Use getSupportedCloudPcRemoteActions to check whether the action is available for a Cloud PC. +// returns a *RequestInformation when successful +func (m *ItemCloudPCsItemSetDeviceNameRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCloudPCsItemSetDeviceNamePostRequestBodyable, requestConfiguration *ItemCloudPCsItemSetDeviceNameRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemCloudPCsItemSetDeviceNameRequestBuilder when successful +func (m *ItemCloudPCsItemSetDeviceNameRequestBuilder) WithUrl(rawUrl string) *ItemCloudPCsItemSetDeviceNameRequestBuilder { + return NewItemCloudPCsItemSetDeviceNameRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_identity_verification_status_request_builder.go b/users/item_identity_verification_status_request_builder.go new file mode 100644 index 00000000000..4f32c3a92f7 --- /dev/null +++ b/users/item_identity_verification_status_request_builder.go @@ -0,0 +1,145 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemIdentityVerificationStatusRequestBuilder provides operations to manage the identityVerificationStatus property of the microsoft.graph.user entity. +type ItemIdentityVerificationStatusRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemIdentityVerificationStatusRequestBuilderGetQueryParameters read a user's identityVerificationStatus, including recent verification events. The response automatically includes up to 10 events, ordered by recency. +type ItemIdentityVerificationStatusRequestBuilderGetQueryParameters struct { + // Expand related entities + Expand []string "uriparametername:\"%24expand\"" + // Select properties to be returned + Select []string "uriparametername:\"%24select\"" +} + +// ItemIdentityVerificationStatusRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemIdentityVerificationStatusRequestBuilderGetQueryParameters +} + +// ItemIdentityVerificationStatusRequestBuilderPatchRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusRequestBuilderPatchRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// NewItemIdentityVerificationStatusRequestBuilderInternal instantiates a new ItemIdentityVerificationStatusRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusRequestBuilder { + m := &ItemIdentityVerificationStatusRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/identityVerificationStatus{?%24expand,%24select}", pathParameters), + } + return m +} + +// NewItemIdentityVerificationStatusRequestBuilder instantiates a new ItemIdentityVerificationStatusRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemIdentityVerificationStatusRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get read a user's identityVerificationStatus, including recent verification events. The response automatically includes up to 10 events, ordered by recency. +// returns a IdentityVerificationStatusable 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/identityverificationstatus-get?view=graph-rest-beta +func (m *ItemIdentityVerificationStatusRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateIdentityVerificationStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationStatusable), nil +} + +// Patch update the navigation property identityVerificationStatus in users +// returns a IdentityVerificationStatusable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemIdentityVerificationStatusRequestBuilder) Patch(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationStatusable, requestConfiguration *ItemIdentityVerificationStatusRequestBuilderPatchRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationStatusable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateIdentityVerificationStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationStatusable), nil +} + +// ToGetRequestInformation read a user's identityVerificationStatus, including recent verification events. The response automatically includes up to 10 events, ordered by recency. +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPatchRequestInformation update the navigation property identityVerificationStatus in users +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationStatusable, requestConfiguration *ItemIdentityVerificationStatusRequestBuilderPatchRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, 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 +} + +// VerificationEvents provides operations to manage the verificationEvents property of the microsoft.graph.identityVerificationStatus entity. +// returns a *ItemIdentityVerificationStatusVerificationEventsRequestBuilder when successful +func (m *ItemIdentityVerificationStatusRequestBuilder) VerificationEvents() *ItemIdentityVerificationStatusVerificationEventsRequestBuilder { + return NewItemIdentityVerificationStatusVerificationEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemIdentityVerificationStatusRequestBuilder when successful +func (m *ItemIdentityVerificationStatusRequestBuilder) WithUrl(rawUrl string) *ItemIdentityVerificationStatusRequestBuilder { + return NewItemIdentityVerificationStatusRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_identity_verification_status_verification_events_count_request_builder.go b/users/item_identity_verification_status_verification_events_count_request_builder.go new file mode 100644 index 00000000000..46f179ed3ff --- /dev/null +++ b/users/item_identity_verification_status_verification_events_count_request_builder.go @@ -0,0 +1,90 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder provides operations to count the resources in the collection. +type ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetQueryParameters get the number of the resource +type ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetQueryParameters struct { + // Filter items by property values + Filter *string "uriparametername:\"%24filter\"" + // Search items by search phrases + Search *string "uriparametername:\"%24search\"" +} + +// ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetQueryParameters +} + +// NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilderInternal instantiates a new ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder { + m := &ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/identityVerificationStatus/verificationEvents/$count{?%24filter,%24search}", pathParameters), + } + return m +} + +// NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilder instantiates a new ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilderInternal(urlParams, requestAdapter) +} + +// Get get the number of the resource +// returns a *int32 when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetRequestConfiguration) (*int32, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "int32", errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*int32), nil +} + +// ToGetRequestInformation get the number of the resource +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "text/plain;q=0.9") + 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. +// returns a *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder when successful +func (m *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder) WithUrl(rawUrl string) *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder { + return NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_identity_verification_status_verification_events_request_builder.go b/users/item_identity_verification_status_verification_events_request_builder.go new file mode 100644 index 00000000000..22ec3622c48 --- /dev/null +++ b/users/item_identity_verification_status_verification_events_request_builder.go @@ -0,0 +1,170 @@ +// Code generated by Microsoft Kiota - DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models" + i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" +) + +// ItemIdentityVerificationStatusVerificationEventsRequestBuilder provides operations to manage the verificationEvents property of the microsoft.graph.identityVerificationStatus entity. +type ItemIdentityVerificationStatusVerificationEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} + +// ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetQueryParameters the user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +type ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetQueryParameters 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\"" +} + +// ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption + // Request query parameters + QueryParameters *ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetQueryParameters +} + +// ItemIdentityVerificationStatusVerificationEventsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. +type ItemIdentityVerificationStatusVerificationEventsRequestBuilderPostRequestConfiguration struct { + // Request headers + Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders + // Request options + Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption +} + +// ByIdentityVerificationEventId provides operations to manage the verificationEvents property of the microsoft.graph.identityVerificationStatus entity. +// returns a *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder when successful +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) ByIdentityVerificationEventId(identityVerificationEventId string) *ItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilder { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if identityVerificationEventId != "" { + urlTplParams["identityVerificationEvent%2Did"] = identityVerificationEventId + } + return NewItemIdentityVerificationStatusVerificationEventsIdentityVerificationEventItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} + +// NewItemIdentityVerificationStatusVerificationEventsRequestBuilderInternal instantiates a new ItemIdentityVerificationStatusVerificationEventsRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusVerificationEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusVerificationEventsRequestBuilder { + m := &ItemIdentityVerificationStatusVerificationEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{user%2Did}/identityVerificationStatus/verificationEvents{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", pathParameters), + } + return m +} + +// NewItemIdentityVerificationStatusVerificationEventsRequestBuilder instantiates a new ItemIdentityVerificationStatusVerificationEventsRequestBuilder and sets the default values. +func NewItemIdentityVerificationStatusVerificationEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ItemIdentityVerificationStatusVerificationEventsRequestBuilder { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemIdentityVerificationStatusVerificationEventsRequestBuilderInternal(urlParams, requestAdapter) +} + +// Count provides operations to count the resources in the collection. +// returns a *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder when successful +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) Count() *ItemIdentityVerificationStatusVerificationEventsCountRequestBuilder { + return NewItemIdentityVerificationStatusVerificationEventsCountRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + +// Get the user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +// returns a IdentityVerificationEventCollectionResponseable when successful +// returns a ODataError error when the service returns a 4XX or 5XX status code +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventCollectionResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ + "XXX": i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459.CreateODataErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateIdentityVerificationEventCollectionResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventCollectionResponseable), nil +} + +// Post record an identityVerificationEvent in a user's identityVerificationStatus. The service recomputes the user's aggregate status when it records the event. +// returns a IdentityVerificationEventable 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/identityverificationstatus-post-verificationevents?view=graph-rest-beta +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) Post(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsRequestBuilderPostRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, 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, ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.CreateIdentityVerificationEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable), nil +} + +// ToGetRequestInformation the user's recent verification events, automatically included when the status is retrieved. Contains up to 10 events, ordered by recency. Older events are removed when the limit is reached. +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + if requestConfiguration != nil { + if requestConfiguration.QueryParameters != nil { + requestInfo.AddQueryParameters(*(requestConfiguration.QueryParameters)) + } + requestInfo.Headers.AddAll(requestConfiguration.Headers) + requestInfo.AddRequestOptions(requestConfiguration.Options) + } + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} + +// ToPostRequestInformation record an identityVerificationEvent in a user's identityVerificationStatus. The service recomputes the user's aggregate status when it records the event. +// returns a *RequestInformation when successful +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.IdentityVerificationEventable, requestConfiguration *ItemIdentityVerificationStatusVerificationEventsRequestBuilderPostRequestConfiguration) (*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. +// returns a *ItemIdentityVerificationStatusVerificationEventsRequestBuilder when successful +func (m *ItemIdentityVerificationStatusVerificationEventsRequestBuilder) WithUrl(rawUrl string) *ItemIdentityVerificationStatusVerificationEventsRequestBuilder { + return NewItemIdentityVerificationStatusVerificationEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/users/item_planner_plans_escaped_v2_plan_item_request_builder.go b/users/item_planner_plans_escaped_v2_plan_item_request_builder.go index 6303028bebd..85ad5270757 100644 --- a/users/item_planner_plans_escaped_v2_plan_item_request_builder.go +++ b/users/item_planner_plans_escaped_v2_plan_item_request_builder.go @@ -15,7 +15,7 @@ type ItemPlannerPlans_v2PlanItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 plans associated with the user. +// ItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of plans in the Planner Unified plans Graph API associated with the user. type ItemPlannerPlans_v2PlanItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemPlannerPlans_v2PlanItemRequestBuilder(rawUrl string, requestAdapter return NewItemPlannerPlans_v2PlanItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 plans associated with the user. +// Get read-only. Nullable. The collection of plans in the Planner Unified plans Graph API associated with the user. // returns a Planable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable, error) { @@ -69,7 +69,7 @@ func (m *ItemPlannerPlans_v2PlanItemRequestBuilder) Get(ctx context.Context, req return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Planable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 plans associated with the user. +// ToGetRequestInformation read-only. Nullable. The collection of plans in the Planner Unified plans Graph API associated with the user. // returns a *RequestInformation when successful func (m *ItemPlannerPlans_v2PlanItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPlannerPlans_v2PlanItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/users/item_planner_tasks_escaped_v2_task_item_request_builder.go b/users/item_planner_tasks_escaped_v2_task_item_request_builder.go index 8c2747b0e37..930cb8f8508 100644 --- a/users/item_planner_tasks_escaped_v2_task_item_request_builder.go +++ b/users/item_planner_tasks_escaped_v2_task_item_request_builder.go @@ -15,7 +15,7 @@ type ItemPlannerTasks_v2TaskItemRequestBuilder struct { i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder } -// ItemPlannerTasks_v2TaskItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of Planner Graph V4 tasks assigned to the user. +// ItemPlannerTasks_v2TaskItemRequestBuilderGetQueryParameters read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API assigned to the user. type ItemPlannerTasks_v2TaskItemRequestBuilderGetQueryParameters struct { // Expand related entities Expand []string "uriparametername:\"%24expand\"" @@ -48,7 +48,7 @@ func NewItemPlannerTasks_v2TaskItemRequestBuilder(rawUrl string, requestAdapter return NewItemPlannerTasks_v2TaskItemRequestBuilderInternal(urlParams, requestAdapter) } -// Get read-only. Nullable. The collection of Planner Graph V4 tasks assigned to the user. +// Get read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API assigned to the user. // returns a Taskable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code func (m *ItemPlannerTasks_v2TaskItemRequestBuilder) Get(ctx context.Context, requestConfiguration *ItemPlannerTasks_v2TaskItemRequestBuilderGetRequestConfiguration) (ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Taskable, error) { @@ -69,7 +69,7 @@ func (m *ItemPlannerTasks_v2TaskItemRequestBuilder) Get(ctx context.Context, req return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.Taskable), nil } -// ToGetRequestInformation read-only. Nullable. The collection of Planner Graph V4 tasks assigned to the user. +// ToGetRequestInformation read-only. Nullable. The collection of tasks in the Planner Unified plans Graph API assigned to the user. // returns a *RequestInformation when successful func (m *ItemPlannerTasks_v2TaskItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ItemPlannerTasks_v2TaskItemRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/users/item_restore_request_builder.go b/users/item_restore_request_builder.go index f22318c250c..c325627f81e 100644 --- a/users/item_restore_request_builder.go +++ b/users/item_restore_request_builder.go @@ -38,7 +38,7 @@ func NewItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee26 return NewItemRestoreRequestBuilderInternal(urlParams, requestAdapter) } -// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// Post restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a DirectoryObjectable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemRestoreRequestBuilder) Post(ctx context.Context, requestConfigurati return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.DirectoryObjectable), nil } -// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. +// ToPostRequestInformation restore a recently deleted directory object from deleted items. The following types are supported:- administrativeUnit- application- agentIdentityBlueprint- agentIdentity- agentIdentityBlueprintPrincipal- agentUser- certificateBasedAuthPki- certificateAuthorityDetail- device- externalUserProfile- group- pendingExternalUserProfile- servicePrincipal- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted. // returns a *RequestInformation when successful func (m *ItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *ItemRestoreRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/users/item_teamwork_sections_item_items_item_move_request_builder.go b/users/item_teamwork_sections_item_items_item_move_request_builder.go index 16b56dc20e5..badd63dc621 100644 --- a/users/item_teamwork_sections_item_items_item_move_request_builder.go +++ b/users/item_teamwork_sections_item_items_item_move_request_builder.go @@ -38,7 +38,7 @@ func NewItemTeamworkSectionsItemItemsItemMoveRequestBuilder(rawUrl string, reque return NewItemTeamworkSectionsItemItemsItemMoveRequestBuilderInternal(urlParams, requestAdapter) } -// Post move an item from one user-defined section to another user-defined section in a user's teamwork. Each item can belong to only one section at a time. This action removes the item from its current section and adds it to the target section. Use this action instead of add when the item is already in a user-defined section. +// Post move an item from one user-defined section to another user-defined section in a user's teamwork. Each item can belong to only one section at a time. This action removes the item from its current section and adds it to the target section. // returns a TeamworkSectionItemable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -62,7 +62,7 @@ func (m *ItemTeamworkSectionsItemItemsItemMoveRequestBuilder) Post(ctx context.C return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkSectionItemable), nil } -// ToPostRequestInformation move an item from one user-defined section to another user-defined section in a user's teamwork. Each item can belong to only one section at a time. This action removes the item from its current section and adds it to the target section. Use this action instead of add when the item is already in a user-defined section. +// ToPostRequestInformation move an item from one user-defined section to another user-defined section in a user's teamwork. Each item can belong to only one section at a time. This action removes the item from its current section and adds it to the target section. // returns a *RequestInformation when successful func (m *ItemTeamworkSectionsItemItemsItemMoveRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamworkSectionsItemItemsItemMovePostRequestBodyable, requestConfiguration *ItemTeamworkSectionsItemItemsItemMoveRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/users/item_teamwork_sections_item_items_request_builder.go b/users/item_teamwork_sections_item_items_request_builder.go index 7a2606adb6e..983fc9d18c3 100644 --- a/users/item_teamwork_sections_item_items_request_builder.go +++ b/users/item_teamwork_sections_item_items_request_builder.go @@ -111,7 +111,7 @@ func (m *ItemTeamworkSectionsItemItemsRequestBuilder) Get(ctx context.Context, r return res.(ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkSectionItemCollectionResponseable), nil } -// Post add an item, such as a chat, channel, meeting, or community, to a user-defined section in a user's teamwork. Each item can belong to only one section at a time. You can only add items that are currently in a system-defined section. If the item is already in another user-defined section, use the move action to relocate it. +// Post add an item, such as a chat, channel, meeting, or community, to a user-defined section in a user's teamwork. An item can belong to only one section at a time. If the item is in a different user-defined section, this request moves it to the target section. If the item is already in the target section, the request succeeds without making changes. // returns a TeamworkSectionItemable when successful // returns a ODataError error when the service returns a 4XX or 5XX status code // [Find more info here] @@ -156,7 +156,7 @@ func (m *ItemTeamworkSectionsItemItemsRequestBuilder) ToGetRequestInformation(ct return requestInfo, nil } -// ToPostRequestInformation add an item, such as a chat, channel, meeting, or community, to a user-defined section in a user's teamwork. Each item can belong to only one section at a time. You can only add items that are currently in a system-defined section. If the item is already in another user-defined section, use the move action to relocate it. +// ToPostRequestInformation add an item, such as a chat, channel, meeting, or community, to a user-defined section in a user's teamwork. An item can belong to only one section at a time. If the item is in a different user-defined section, this request moves it to the target section. If the item is already in the target section, the request succeeds without making changes. // returns a *RequestInformation when successful func (m *ItemTeamworkSectionsItemItemsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be.TeamworkSectionItemable, requestConfiguration *ItemTeamworkSectionsItemItemsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) diff --git a/users/user_item_request_builder.go b/users/user_item_request_builder.go index 6722c32bdff..6dacd96431c 100644 --- a/users/user_item_request_builder.go +++ b/users/user_item_request_builder.go @@ -462,6 +462,12 @@ func (m *UserItemRequestBuilder) GetPasswordSingleSignOnCredentials() *ItemGetPa return NewItemGetPasswordSingleSignOnCredentialsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } +// IdentityVerificationStatus provides operations to manage the identityVerificationStatus property of the microsoft.graph.user entity. +// returns a *ItemIdentityVerificationStatusRequestBuilder when successful +func (m *UserItemRequestBuilder) IdentityVerificationStatus() *ItemIdentityVerificationStatusRequestBuilder { + return NewItemIdentityVerificationStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} + // InferenceClassification provides operations to manage the inferenceClassification property of the microsoft.graph.user entity. // returns a *ItemInferenceClassificationRequestBuilder when successful func (m *UserItemRequestBuilder) InferenceClassification() *ItemInferenceClassificationRequestBuilder {