// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new Printer
{
Location = new PrinterLocation
{
Latitude = 1.1d,
Longitude = 2.2d,
AltitudeInMeters = 3,
},
AdditionalData = new Dictionary<string, object>
{
{
"name" , "PrinterName"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Print.Printers["{printer-id}"].PatchAsync(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.NewPrinter()
location := graphmodels.NewPrinterLocation()
latitude := float64(1.1)
location.SetLatitude(&latitude)
longitude := float64(2.2)
location.SetLongitude(&longitude)
altitudeInMeters := int32(3)
location.SetAltitudeInMeters(&altitudeInMeters)
requestBody.SetLocation(location)
additionalData := map[string]interface{}{
"name" : "PrinterName",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
printers, err := graphClient.Print().Printers().ByPrinterId("printer-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Printer printer = new Printer();
PrinterLocation location = new PrinterLocation();
location.setLatitude(1.1d);
location.setLongitude(2.2d);
location.setAltitudeInMeters(3);
printer.setLocation(location);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("name", "PrinterName");
printer.setAdditionalData(additionalData);
Printer result = graphClient.print().printers().byPrinterId("{printer-id}").patch(printer);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.printer import Printer
from msgraph.generated.models.printer_location import PrinterLocation
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Printer(
location = PrinterLocation(
latitude = 1.1,
longitude = 2.2,
altitude_in_meters = 3,
),
additional_data = {
"name" : "PrinterName",
}
)
result = await graph_client.print.printers.by_printer_id('printer-id').patch(request_body)