更新 macOSOfficeSuiteApp
本文内容
命名空间:microsoft.graph
注意: 适用于 Intune 的 Microsoft Graph API 需要适用于租户的活动 Intune 许可证 。
更新 macOSOfficeSuiteApp 对象的属性。
此 API 可用于以下国家级云部署 。
全局服务
美国政府 L4
美国政府 L5 (DOD)
由世纪互联运营的中国
✅
✅
✅
✅
权限
要调用此 API,需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
DeviceManagementApps.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
DeviceManagementApps.ReadWrite.All
HTTP 请求
PATCH /deviceAppManagement/mobileApps/{mobileAppId}
标头
值
Authorization
持有者 {token}。 必填。 详细了解 身份验证和授权 。
接受
application/json
请求正文
在请求正文中,提供 macOSOfficeSuiteApp 对象的 JSON 表示形式。
下表显示创建 macOSOfficeSuiteApp 时所需的属性。
响应
如果成功,此方法会在响应正文中返回 200 OK
响应代码和更新的 macOSOfficeSuiteApp 对象。
示例
请求
下面是一个请求示例。
PATCH https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps/{mobileAppId}
Content-type: application/json
Content-length: 584
{
"@odata.type": "#microsoft.graph.macOSOfficeSuiteApp",
"displayName": "Display Name value",
"description": "Description value",
"publisher": "Publisher value",
"largeIcon": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
},
"isFeatured": true,
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",
"informationUrl": "https://example.com/informationUrl/",
"owner": "Owner value",
"developer": "Developer value",
"notes": "Notes value",
"publishingState": "processing"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MacOSOfficeSuiteApp
{
OdataType = "#microsoft.graph.macOSOfficeSuiteApp",
DisplayName = "Display Name value",
Description = "Description value",
Publisher = "Publisher value",
LargeIcon = new MimeContent
{
OdataType = "microsoft.graph.mimeContent",
Type = "Type value",
Value = Convert.FromBase64String("dmFsdWU="),
},
IsFeatured = true,
PrivacyInformationUrl = "https://example.com/privacyInformationUrl/",
InformationUrl = "https://example.com/informationUrl/",
Owner = "Owner value",
Developer = "Developer value",
Notes = "Notes value",
PublishingState = MobileAppPublishingState.Processing,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.MobileApps["{mobileApp-id}"].PatchAsync(requestBody);
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
mgc device-app-management mobile-apps patch --mobile-app-id {mobileApp-id} --body '{\
"@odata.type": "#microsoft.graph.macOSOfficeSuiteApp",\
"displayName": "Display Name value",\
"description": "Description value",\
"publisher": "Publisher value",\
"largeIcon": {\
"@odata.type": "microsoft.graph.mimeContent",\
"type": "Type value",\
"value": "dmFsdWU="\
},\
"isFeatured": true,\
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",\
"informationUrl": "https://example.com/informationUrl/",\
"owner": "Owner value",\
"developer": "Developer value",\
"notes": "Notes value",\
"publishingState": "processing"\
}\
'
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMobileApp()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
publisher := "Publisher value"
requestBody.SetPublisher(&publisher)
largeIcon := graphmodels.NewMimeContent()
type := "Type value"
largeIcon.SetType(&type)
value := []byte("dmFsdWU=")
largeIcon.SetValue(&value)
requestBody.SetLargeIcon(largeIcon)
isFeatured := true
requestBody.SetIsFeatured(&isFeatured)
privacyInformationUrl := "https://example.com/privacyInformationUrl/"
requestBody.SetPrivacyInformationUrl(&privacyInformationUrl)
informationUrl := "https://example.com/informationUrl/"
requestBody.SetInformationUrl(&informationUrl)
owner := "Owner value"
requestBody.SetOwner(&owner)
developer := "Developer value"
requestBody.SetDeveloper(&developer)
notes := "Notes value"
requestBody.SetNotes(¬es)
publishingState := graphmodels.PROCESSING_MOBILEAPPPUBLISHINGSTATE
requestBody.SetPublishingState(&publishingState)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mobileApps, err := graphClient.DeviceAppManagement().MobileApps().ByMobileAppId("mobileApp-id").Patch(context.Background(), requestBody, nil)
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MacOSOfficeSuiteApp mobileApp = new MacOSOfficeSuiteApp();
mobileApp.setOdataType("#microsoft.graph.macOSOfficeSuiteApp");
mobileApp.setDisplayName("Display Name value");
mobileApp.setDescription("Description value");
mobileApp.setPublisher("Publisher value");
MimeContent largeIcon = new MimeContent();
largeIcon.setOdataType("microsoft.graph.mimeContent");
largeIcon.setType("Type value");
byte[] value = Base64.getDecoder().decode("dmFsdWU=");
largeIcon.setValue(value);
mobileApp.setLargeIcon(largeIcon);
mobileApp.setIsFeatured(true);
mobileApp.setPrivacyInformationUrl("https://example.com/privacyInformationUrl/");
mobileApp.setInformationUrl("https://example.com/informationUrl/");
mobileApp.setOwner("Owner value");
mobileApp.setDeveloper("Developer value");
mobileApp.setNotes("Notes value");
mobileApp.setPublishingState(MobileAppPublishingState.Processing);
MobileApp result = graphClient.deviceAppManagement().mobileApps().byMobileAppId("{mobileApp-id}").patch(mobileApp);
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
const mobileApp = {
'@odata.type': '#microsoft.graph.macOSOfficeSuiteApp',
displayName: 'Display Name value',
description: 'Description value',
publisher: 'Publisher value',
largeIcon: {
'@odata.type': 'microsoft.graph.mimeContent',
type: 'Type value',
value: 'dmFsdWU='
},
isFeatured: true,
privacyInformationUrl: 'https://example.com/privacyInformationUrl/',
informationUrl: 'https://example.com/informationUrl/',
owner: 'Owner value',
developer: 'Developer value',
notes: 'Notes value',
publishingState: 'processing'
};
await client.api('/deviceAppManagement/mobileApps/{mobileAppId}')
.update(mobileApp);
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MacOSOfficeSuiteApp;
use Microsoft\Graph\Generated\Models\MimeContent;
use Microsoft\Graph\Generated\Models\MobileAppPublishingState;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MacOSOfficeSuiteApp();
$requestBody->setOdataType('#microsoft.graph.macOSOfficeSuiteApp');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDescription('Description value');
$requestBody->setPublisher('Publisher value');
$largeIcon = new MimeContent();
$largeIcon->setOdataType('microsoft.graph.mimeContent');
$largeIcon->setType('Type value');
$largeIcon->setValue(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('dmFsdWU=')));
$requestBody->setLargeIcon($largeIcon);
$requestBody->setIsFeatured(true);
$requestBody->setPrivacyInformationUrl('https://example.com/privacyInformationUrl/');
$requestBody->setInformationUrl('https://example.com/informationUrl/');
$requestBody->setOwner('Owner value');
$requestBody->setDeveloper('Developer value');
$requestBody->setNotes('Notes value');
$requestBody->setPublishingState(new MobileAppPublishingState('processing'));
$result = $graphServiceClient->deviceAppManagement()->mobileApps()->byMobileAppId('mobileApp-id')->patch($requestBody)->wait();
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.macOSOfficeSuiteApp"
displayName = "Display Name value"
description = "Description value"
publisher = "Publisher value"
largeIcon = @{
"@odata.type" = "microsoft.graph.mimeContent"
type = "Type value"
value = [System.Text.Encoding]::ASCII.GetBytes("dmFsdWU=")
}
isFeatured = $true
privacyInformationUrl = "https://example.com/privacyInformationUrl/"
informationUrl = "https://example.com/informationUrl/"
owner = "Owner value"
developer = "Developer value"
notes = "Notes value"
publishingState = "processing"
}
Update-MgDeviceAppManagementMobileApp -MobileAppId $mobileAppId -BodyParameter $params
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.mac_o_s_office_suite_app import MacOSOfficeSuiteApp
from msgraph.generated.models.mime_content import MimeContent
from msgraph.generated.models.mobile_app_publishing_state import MobileAppPublishingState
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MacOSOfficeSuiteApp(
odata_type = "#microsoft.graph.macOSOfficeSuiteApp",
display_name = "Display Name value",
description = "Description value",
publisher = "Publisher value",
large_icon = MimeContent(
odata_type = "microsoft.graph.mimeContent",
type = "Type value",
value = base64.urlsafe_b64decode("dmFsdWU="),
),
is_featured = True,
privacy_information_url = "https://example.com/privacyInformationUrl/",
information_url = "https://example.com/informationUrl/",
owner = "Owner value",
developer = "Developer value",
notes = "Notes value",
publishing_state = MobileAppPublishingState.Processing,
)
result = await graph_client.device_app_management.mobile_apps.by_mobile_app_id('mobileApp-id').patch(request_body)
有关如何将 SDK 添加 到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
响应
下面是一个响应示例。 注意:为简洁起见,可能会截断此处显示的响应对象。 将从实际调用中返回所有属性。
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 756
{
"@odata.type": "#microsoft.graph.macOSOfficeSuiteApp",
"id": "bf39e35d-e35d-bf39-5de3-39bf5de339bf",
"displayName": "Display Name value",
"description": "Description value",
"publisher": "Publisher value",
"largeIcon": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
},
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"isFeatured": true,
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",
"informationUrl": "https://example.com/informationUrl/",
"owner": "Owner value",
"developer": "Developer value",
"notes": "Notes value",
"publishingState": "processing"
}