// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new DetectedApp
{
OdataType = "#microsoft.graph.detectedApp",
DisplayName = "Display Name value",
Version = "Version value",
SizeInByte = 10L,
DeviceCount = 11,
Publisher = "Publisher value",
Platform = DetectedAppPlatformType.Windows,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DetectedApps.PostAsync(requestBody);
// 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.NewDetectedApp()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
version := "Version value"
requestBody.SetVersion(&version)
sizeInByte := int64(10)
requestBody.SetSizeInByte(&sizeInByte)
deviceCount := int32(11)
requestBody.SetDeviceCount(&deviceCount)
publisher := "Publisher value"
requestBody.SetPublisher(&publisher)
platform := graphmodels.WINDOWS_DETECTEDAPPPLATFORMTYPE
requestBody.SetPlatform(&platform)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
detectedApps, err := graphClient.DeviceManagement().DetectedApps().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
DetectedApp detectedApp = new DetectedApp();
detectedApp.setOdataType("#microsoft.graph.detectedApp");
detectedApp.setDisplayName("Display Name value");
detectedApp.setVersion("Version value");
detectedApp.setSizeInByte(10L);
detectedApp.setDeviceCount(11);
detectedApp.setPublisher("Publisher value");
detectedApp.setPlatform(DetectedAppPlatformType.Windows);
DetectedApp result = graphClient.deviceManagement().detectedApps().post(detectedApp);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.detected_app import DetectedApp
from msgraph.generated.models.detected_app_platform_type import DetectedAppPlatformType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = DetectedApp(
odata_type = "#microsoft.graph.detectedApp",
display_name = "Display Name value",
version = "Version value",
size_in_byte = 10,
device_count = 11,
publisher = "Publisher value",
platform = DetectedAppPlatformType.Windows,
)
result = await graph_client.device_management.detected_apps.post(request_body)