diff --git a/api-reference/beta/api/changetrackedentity-stagefordeletion.md b/api-reference/beta/api/changetrackedentity-stagefordeletion.md new file mode 100644 index 00000000000..d89893b7750 --- /dev/null +++ b/api-reference/beta/api/changetrackedentity-stagefordeletion.md @@ -0,0 +1,168 @@ +--- +title: "changeTrackedEntity: stageForDeletion" +description: "Stage the deletion of an openShift, shift, or timeOff instance in a [schedule](../resources/schedule.md) in draft mode." +author: "raulfernandes" +ms.localizationpriority: medium +ms.prod: "microsoft-teams" +doc_type: apiPageType +--- + +# changeTrackedEntity: stageForDeletion + +Namespace: microsoft.graph + +[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] + +Stage the deletion of an [openShift](../resources/openshift.md), [shift](../resources/shift.md), or [timeOff](../resources/timeoff.md) instance in a [schedule](../resources/schedule.md) in draft mode. + +Draft changes are only visible to managers. Team members are not sent notification for draft changes. The deletion is finalized when the schedule is [shared](../api/schedule-share.md). + +## Permissions + +One of the following permissions is required to call this API. To learn more, including how to choose permissions, see [Permissions](/graph/permissions-reference). + + +[!INCLUDE [permissions-table](../includes/permissions/changetrackedentity-stagefordeletion-permissions.md)] + +## HTTP request + +For an **openShift**: + +``` http +POST /teams/{teamsId}/schedule/openShifts/{openShiftId}/stageForDeletion +``` + +For a **shift**: + +``` http +POST /teams/{teamsId}/schedule/shifts/{shiftId}/stageForDeletion +``` + +For a **timeOff**: + +``` http +POST /teams/{teamsId}/schedule/timesOff/{timeOffId}/stageForDeletion +``` + +## Request headers + +|Name|Description| +|:---|:---| +|Authorization|Bearer {token}. Required.| +| MS-APP-ACTS-AS | A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. | + +## Request body + +Don't supply a request body for this method. + +## Response + +If successful, this method returns a `204 No Content` response code. + +## Examples + +### Example 1: Stage the deletion of an openShift + +The following example shows how to stage the deletion of an **openShift** in a **schedule** in draft mode. + +#### Request + +The following example shows a request. + + +``` http +POST https://graph.microsoft.com/beta/teams/3d88b7a2-f988-4f4b-bb34-d66df66af126/schedule/openShifts/OPNSHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8/stageForDeletion +``` + +#### Response + +The following example shows the response. + + +``` http +HTTP/1.1 204 No Content +``` + +### Example 2: Stage the deletion of a shift + +The following example shows how to stage the deletion of a **shift** in a **schedule** in draft mode. + +#### Request + +The following example shows a request. + + +``` http +POST https://graph.microsoft.com/beta/teams/3d88b7a2-f988-4f4b-bb34-d66df66af126/schedule/shifts/SHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8/stageForDeletion +``` + +#### Response + +The following example shows the response. + + +``` http +HTTP/1.1 204 No Content +``` + +### Example 3: Stage the deletion of a timeOff + +The following example shows how to stage the deletion of a **timeOff** in a **schedule** in draft mode. + +#### Request + +The following example shows a request. + + +``` http +POST https://graph.microsoft.com/beta/teams/3d88b7a2-f988-4f4b-bb34-d66df66af126/schedule/timesOff/SHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8/stageForDeletion +``` + +#### Response + +The following example shows the response. + + +``` http +HTTP/1.1 204 No Content +``` diff --git a/api-reference/beta/api/community-get.md b/api-reference/beta/api/community-get.md index 7b566aa92e8..82fd97320bf 100644 --- a/api-reference/beta/api/community-get.md +++ b/api-reference/beta/api/community-get.md @@ -60,6 +60,7 @@ If successful, this method returns a `200 OK` response code and a [community](.. The following example shows a request. +# [HTTP](#tab/http) +[!INCLUDE [permissions-table](../includes/permissions/team-getopenshifts-permissions.md)] + +## HTTP request + + +``` http +GET /me/joinedTeams/getOpenShifts +GET /users/{id | user-principal-name}/joinedTeams/getOpenShifts +``` + +## Optional query parameters + +This method supports the `$top` and `$filter` [OData query parameters](/graph/query-parameters) to help customize the response. + +> [!NOTE] +> The `$filter` parameter supports the **sharedOpenShift/startDateTime**, **sharedOpenShift/endDateTime**, and **teamId** properties. It doesn't support the use of the same property more than once in a query. For example, the following query doesn't work: `sharedOpenShift/startDateTime ge 2024-05-09T00:00:00Z and sharedOpenShift/startDateTime le 2024-05-09T23:59:59Z`; however, the following query works: `sharedOpenShift/startDateTime ge 2024-05-09T00:00:00Z and sharedOpenShift/endDateTime le 2024-05-09T23:59:59Z`. + +## Request headers + +|Name|Description| +|:---|:---| +| Authorization|Bearer {token}. Required.| +| MS-APP-ACTS-AS | A user ID (GUID). Required only if the authorization token is an application token; otherwise, optional. | + +## Request body + +Don't supply a request body for this method. + +## Response + +If successful, this method returns a `200 OK` response code and a collection of [openShift](../resources/openshift.md) objects in the response body. + +## Examples + +### Request + +The following example shows a request. + + +```msgraph-interactive +GET https://graph.microsoft.com/beta/me/joinedTeams/getOpenShifts +``` + +### Response + +The following example shows the response. + +>**Note:** The response object shown here might be shortened for readability. + +``` http +HTTP/1.1 200 OK +Content-Type: application/json + +{ + "value": [ + { + "createdDateTime": "2019-03-14T04:32:51.451Z", + "draftOpenShift": { + "activities": [ + { + "code": "Break", + "displayName": "Lunch", + "endDateTime": "2018-10-04T07:58:45.332Z", + "isPaid": true, + "startDateTime": "2018-10-04T00:58:45.340Z" + } + ], + "displayName": "Day shift", + "endDateTime": "2018-10-04T08:58:45.340Z", + "notes": "Inventory Management", + "openSlotCount": 3, + "startDateTime": "2018-10-04T00:58:45.332Z", + "theme": "white" + }, + "id": "OPNSHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8", + "lastModifiedBy": { + "application": null, + "conversation": null, + "device": null, + "user": { + "displayName": "John Doe", + "id": "366c0b19-49b1-41b5-a03f-9f3887bd0ed8" + } + }, + "lastModifiedDateTime": "2019-03-14T05:32:51.451Z", + "schedulingGroupId": "TAG_228940ed-ff84-4e25-b129-1b395cf78be0", + "sharedOpenShift": { + "activities": [ + { + "code": "", + "displayName": "Lunch", + "endDateTime": "2018-10-04T01:58:45.340Z", + "isPaid": true, + "startDateTime": "2018-10-04T00:58:45.340Z" + } + ], + "displayName": "Day shift", + "endDateTime": "2018-10-04T09:50:45.332Z", + "notes": "Inventory Management", + "openSlotCount": 2, + "startDateTime": "2018-10-04T00:58:45.340Z", + "theme": "white" + }, + "schedulingGroupName": "Cashiers", + "teamId": "228940ed-ff84-4e25-b129-1b395cf78be0", + "teamName": "Downtown shop" + } + ] +} +``` diff --git a/api-reference/beta/api/teamwork-get.md b/api-reference/beta/api/teamwork-get.md index ec9e95a3f4a..36535b14754 100644 --- a/api-reference/beta/api/teamwork-get.md +++ b/api-reference/beta/api/teamwork-get.md @@ -53,6 +53,7 @@ If successful, this method returns a `200 OK` response code along with a [teamwo The following example shows a request. +# [HTTP](#tab/http) - -```json + "keyProperty": "id", + "@odata.type": "microsoft.graph.openShift", + "baseType": "microsoft.graph.changeTrackedEntity", + "openType": false +} +--> +``` json { + "@odata.type": "#microsoft.graph.openShift", + "createdBy": {"@odata.type": "microsoft.graph.identitySet"}, + "createdDateTime": "String (timestamp)", "draftOpenShift": {"@odata.type": "microsoft.graph.openShiftItem"}, + "id": "String (identifier)", + "isStagedForDeletion": "Boolean", + "lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"}, + "lastModifiedDateTime": "String (timestamp)", "schedulingGroupId": "String", - "sharedOpenShift": {"@odata.type": "microsoft.graph.openShiftItem"} + "schedulingGroupName": "String", + "sharedOpenShift": {"@odata.type": "microsoft.graph.openShiftItem"}, + "teamId": "String", + "teamName": "String" } ``` - - - - - diff --git a/api-reference/beta/resources/openshiftitem.md b/api-reference/beta/resources/openshiftitem.md index 503b8b3dfbc..2ace046c8e4 100644 --- a/api-reference/beta/resources/openshiftitem.md +++ b/api-reference/beta/resources/openshiftitem.md @@ -1,6 +1,6 @@ --- title: "openShiftItem resource type" -description: "Represents a single count of an open shift." +description: "Represents the details of an open shift." ms.localizationpriority: medium author: "akumar39" ms.prod: "microsoft-teams" @@ -13,17 +13,25 @@ Namespace: microsoft.graph [!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] -Represents a single count of an [openshift](../resources/openshift.md). +Represents the details of an [open shift](../resources/openshift.md). + +Inherits from [shiftItem](../resources/shiftitem.md). ## Properties | Property | Type | Description | |:-------------|:------------|:------------| +| activities | [shiftActivity](shiftactivity.md) collection | An incremental part of a shift that can cover details of when and where an employee is during their shift. For example, an assignment, a scheduled break, or lunch. Required. Inherited from [shiftItem](../resources/shiftitem.md). | +| displayName | String | The shift label of the **openShift**. Inherited from [shiftItem](../resources/shiftitem.md). | +| endDateTime | DateTimeOffset | The end date and time for the **openShift**. Required. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. Inherited from [shiftItem](../resources/shiftitem.md). | +| notes | String | The shift notes for the **openShift**. Inherited from [shiftItem](../resources/shiftitem.md). | |openSlotCount|Int32| Count of the number of slots for the given open shift.| +| startDateTime | DateTimeOffset | The start date and time for the **openShift**. Required. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. Inherited from [shiftItem](../resources/shiftitem.md). | +| theme | scheduleEntityTheme | The color of the open shift. Possible values are: `white`, `blue`, `green`, `purple`, `pink`, `yellow`, `gray`, `darkBlue`, `darkGreen`, `darkPurple`, `darkPink`, `darkYellow`, `unknownFutureValue`. Inherited from [shiftItem](../resources/shiftitem.md). | ## JSON representation -Here's a JSON representation of the resource. +The following JSON representation shows the resource type. ```json { - "createdDateTime": "DateTimeOffset", + "createdBy": {"@odata.type": "microsoft.graph.identitySet"}, + "createdDateTime": "String (timestamp)", "draftShift": { "@odata.type": "microsoft.graph.shiftItem" }, - "id": "String", + "id": "String (identifier)", + "isStagedForDeletion": "Boolean", "lastModifiedBy": { "@odata.type": "microsoft.graph.identitySet" }, - "lastModifiedDateTime": "DateTimeOffset", + "lastModifiedDateTime": "String (timestamp)", "schedulingGroupId": "String", "sharedShift": { "@odata.type": "microsoft.graph.shiftItem" }, "userId": "String" diff --git a/api-reference/beta/resources/team.md b/api-reference/beta/resources/team.md index 62a7564e6f1..cf3b29938a8 100644 --- a/api-reference/beta/resources/team.md +++ b/api-reference/beta/resources/team.md @@ -51,6 +51,7 @@ Every team is associated with a [Microsoft 365 group](../resources/group.md). Th |[Upgrade app installed in team](../api/team-teamsappinstallation-upgrade.md) | None | Upgrade the app installed in a team to the latest version.| |[Remove app from team](../api/team-delete-installedapps.md) | None | Remove (uninstall) an app from a team.| |[List permission grants](../api/team-list-permissiongrants.md) | [resourceSpecificPermissionGrant](resourcespecificpermissiongrant.md) collection | List permissions that have been granted to apps to access the team.| +|[Get open shifts across all joined teams](../api/team-getopenshifts.md)|[openShift](../resources/openshift.md) collection|Get all [openShift](../resources/openshift.md) objects across all teams a user is a direct member of.| ## Properties diff --git a/api-reference/beta/resources/timeoff.md b/api-reference/beta/resources/timeoff.md index d184497e9b5..36d291fe420 100644 --- a/api-reference/beta/resources/timeoff.md +++ b/api-reference/beta/resources/timeoff.md @@ -1,6 +1,6 @@ --- title: "timeOff resource type" -description: "Represents a unit of non-work in a schedule." +description: "Represents a unit of nonwork in a schedule." author: "aaku" ms.localizationpriority: medium ms.prod: "microsoft-teams" @@ -13,33 +13,38 @@ Namespace: microsoft.graph [!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] -Represents a unit of non-work in a [schedule](../resources/schedule.md). +Represents a unit of nonwork in a [schedule](../resources/schedule.md). + +Inherits from [changeTrackedEntity](../resources/changetrackedentity.md). ## Methods | Method | Return type | Description | | :----------------------------------------- | :------------------------------- | :---------------------------------------------------- | -| [Create](../api/schedule-post-timesoff.md) | [timeOff](timeoff.md) | Create a new **timeOff** object. | -| [List](../api/schedule-list-timesoff.md) | [timeOff](timeoff.md) collection | Get the list of **timeOff** objects in this schedule. | -| [Get](../api/timeoff-get.md) | [timeOff](timeoff.md) | Get a **timeOff** object by ID. | -| [Replace](../api/timeoff-put.md) | [timeOff](timeoff.md) | Replace a **timeOff** object. | -| [Delete](../api/timeoff-delete.md) | None | Delete a **timeOff** object from the schedule. | +| [List timeOff](../api/schedule-list-timesoff.md) | [timeOff](timeoff.md) collection | Get the list of **timeOff** objects in a schedule. | +| [Create timeOff](../api/schedule-post-timesoff.md) | [timeOff](timeoff.md) | Create a new **timeOff** object. | +| [Get timeOff](../api/timeoff-get.md) | [timeOff](timeoff.md) | Get a **timeOff** object by ID. | +| [Replace timeOff](../api/timeoff-put.md) | [timeOff](timeoff.md) | Replace a **timeOff** object. | +| [Delete timeOff](../api/timeoff-delete.md) | None | Delete a **timeOff** object from the schedule. | +| [Stage for deletion](../api/changetrackedentity-stagefordeletion.md)| None |Stage the deletion of a [timeOff](timeoff.md) in a [schedule](schedule.md) in draft mode.| ## Properties -| Property | Type | Description | -|:---------------------|:------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| createdDateTime | DateTimeOffset | The time stamp at which this **timeOff** was first created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. | -| draftTimeOff | [timeOffItem](timeoffitem.md) | The draft version of this **timeOff** that is viewable by managers. Required. | -| id | String | ID of the **timeOff**. | -| lastModifiedBy | [identitySet](identityset.md) | The identity that last updated this **timeOff**. | -| lastModifiedDateTime | DateTimeOffset | The time stamp at which this **timeOff** was last updated. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. | -| sharedTimeOff | [timeOffItem](timeoffitem.md) | The shared version of this **timeOff** that is viewable by both employees and managers. Required. | -| userId | String | ID of the user assigned to the **timeOff**. Required. | +| Property | Type | Description | +|:---------------------|:------------------------------|:----------------------------| +| createdBy | [identitySet](identityset.md) | Identity of the user who created the **timeOff** object. Inherited from [changeTrackedEntity](../resources/changetrackedentity.md). | +| createdDateTime | DateTimeOffset | The date and time when this **timeOff** was first created. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. Inherited from [changeTrackedEntity](../resources/changetrackedentity.md). | +| draftTimeOff | [timeOffItem](timeoffitem.md) | Draft changes in the **timeOff** are only visible to managers until they're [shared](../api/schedule-share.md).| +| id | String | The unique identifier for the **timeOff**. Inherited from [changeTrackedEntity](../resources/changetrackedentity.md). | +| isStagedForDeletion | Boolean | The **timeOff** is marked for deletion, a process that is finalized when the schedule is [shared](../api/schedule-share.md). | +| lastModifiedBy | [identitySet](identityset.md) | The identity of the user who last updated this **timeOff**. Inherited from [changeTrackedEntity](../resources/changetrackedentity.md). | +| lastModifiedDateTime | DateTimeOffset | The date and time when this **timeOff** was last updated. The timestamp type represents date and time information using ISO 8601 format and is always in UTC. For example, midnight UTC on Jan 1, 2014 is `2014-01-01T00:00:00Z`. Inherited from [changeTrackedEntity](../resources/changetrackedentity.md). | +| sharedTimeOff | [timeOffItem](timeoffitem.md) | The shared version of this **timeOff** that is viewable by both employees and managers. | +| userId | String | ID of the user assigned to the **timeOff**. Required. | ## JSON representation -The following is a JSON representation of the resource. +The following JSON representation shows the resource type. -> [!IMPORTANT] -> The Microsoft Graph command-line interface (CLI) is currently in preview. Use of this CLI in production is not supported.