Données qui représentent le document PDF des conditions d’utilisation.
fileName
Chaîne
Nom du fichier d’accord (par exemple, TOU.pdf).
isDefault
Valeur booléenne
Si aucune des langues ne correspond à la préférence du client, indique s’il s’agit du fichier de contrat par défaut. Si aucun des fichiers n’est marqué comme fichier par défaut, le premier est traité comme étant la valeur par défaut. En lecture seule.
isMajorVersion
Valeur booléenne
Indique si le fichier de contrat est une mise à jour de version majeure. Les mises à jour de version principale invalident les acceptations du contrat sur la langue correspondante.
language
Chaîne
Langue du fichier de contrat au format « languagecode2-country/regioncode2 ». « languagecode2 » est un code à deux lettres minuscules dérivé de la norme ISO 639-1, tandis que « country/regioncode2 » est dérivé de la norme ISO 3166 et se compose généralement de deux lettres majuscules ou d’une balise de langue BCP-47. Par exemple, l’anglais américain est en-US.
Réponse
Si elle réussit, cette méthode renvoie un 200 OK code de réponse et un objet agreementFileLocalization dans le corps de la réponse.
POST https://graph.microsoft.com/v1.0/identityGovernance/termsOfUse/agreements/94410bbf-3d3e-4683-8149-f034e55c39dd/files
Content-Type: application/json
{
"fileName": "Contoso ToU for guest users (French)",
"language": "fr-FR",
"isDefault": false,
"isMajorVersion": false,
"displayName": "Contoso ToU for guest users (French)",
"fileData": {
"data": "base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AgreementFileLocalization
{
FileName = "Contoso ToU for guest users (French)",
Language = "fr-FR",
IsDefault = false,
IsMajorVersion = false,
DisplayName = "Contoso ToU for guest users (French)",
FileData = new AgreementFileData
{
Data = Convert.FromBase64String("base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data"),
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.TermsOfUse.Agreements["{agreement-id}"].Files.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.NewAgreementFileLocalization()
fileName := "Contoso ToU for guest users (French)"
requestBody.SetFileName(&fileName)
language := "fr-FR"
requestBody.SetLanguage(&language)
isDefault := false
requestBody.SetIsDefault(&isDefault)
isMajorVersion := false
requestBody.SetIsMajorVersion(&isMajorVersion)
displayName := "Contoso ToU for guest users (French)"
requestBody.SetDisplayName(&displayName)
fileData := graphmodels.NewAgreementFileData()
data := []byte("base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data")
fileData.SetData(&data)
requestBody.SetFileData(fileData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
files, err := graphClient.IdentityGovernance().TermsOfUse().Agreements().ByAgreementId("agreement-id").Files().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AgreementFileLocalization agreementFileLocalization = new AgreementFileLocalization();
agreementFileLocalization.setFileName("Contoso ToU for guest users (French)");
agreementFileLocalization.setLanguage("fr-FR");
agreementFileLocalization.setIsDefault(false);
agreementFileLocalization.setIsMajorVersion(false);
agreementFileLocalization.setDisplayName("Contoso ToU for guest users (French)");
AgreementFileData fileData = new AgreementFileData();
byte[] data = Base64.getDecoder().decode("base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data");
fileData.setData(data);
agreementFileLocalization.setFileData(fileData);
AgreementFileLocalization result = graphClient.identityGovernance().termsOfUse().agreements().byAgreementId("{agreement-id}").files().post(agreementFileLocalization);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AgreementFileLocalization;
use Microsoft\Graph\Generated\Models\AgreementFileData;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AgreementFileLocalization();
$requestBody->setFileName('Contoso ToU for guest users (French)');
$requestBody->setLanguage('fr-FR');
$requestBody->setIsDefault(false);
$requestBody->setIsMajorVersion(false);
$requestBody->setDisplayName('Contoso ToU for guest users (French)');
$fileData = new AgreementFileData();
$fileData->setData(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data')));
$requestBody->setFileData($fileData);
$result = $graphServiceClient->identityGovernance()->termsOfUse()->agreements()->byAgreementId('agreement-id')->files()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.agreement_file_localization import AgreementFileLocalization
from msgraph.generated.models.agreement_file_data import AgreementFileData
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AgreementFileLocalization(
file_name = "Contoso ToU for guest users (French)",
language = "fr-FR",
is_default = False,
is_major_version = False,
display_name = "Contoso ToU for guest users (French)",
file_data = AgreementFileData(
data = base64.urlsafe_b64decode("base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data"),
),
)
result = await graph_client.identity_governance.terms_of_use.agreements.by_agreement_id('agreement-id').files.post(request_body)