Files

40 lines
1.4 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how to Patch a monitored GitHub repository.
*
* @summary Patch a monitored GitHub repository.
* x-ms-original-file: specification/securitydevops/resource-manager/Microsoft.SecurityDevOps/preview/2022-09-01-preview/examples/GitHubOwnerUpdate.json
*/
import type { GitHubOwner, GitHubOwnerUpdateOptionalParams } from "@azure/arm-securitydevops";
import { MicrosoftSecurityDevOps } from "@azure/arm-securitydevops";
import { DefaultAzureCredential } from "@azure/identity";
import "dotenv/config";
async function gitHubOwnerUpdate(): Promise<void> {
const subscriptionId =
process.env["SECURITYDEVOPS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["SECURITYDEVOPS_RESOURCE_GROUP"] || "westusrg";
const gitHubConnectorName = "testconnector";
const gitHubOwnerName = "Azure";
const gitHubOwner: GitHubOwner = {};
const options: GitHubOwnerUpdateOptionalParams = { gitHubOwner };
const credential = new DefaultAzureCredential();
const client = new MicrosoftSecurityDevOps(credential, subscriptionId);
const result = await client.gitHubOwnerOperations.beginUpdateAndWait(
resourceGroupName,
gitHubConnectorName,
gitHubOwnerName,
options,
);
console.log(result);
}
async function main(): Promise<void> {
await gitHubOwnerUpdate();
}
main().catch(console.error);