@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
99 lines • 3.84 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.WikiPage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages Wiki pages within Azure DevOps project.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* description: "Managed by Pulumi",
* });
* const exampleWiki = new azuredevops.Wiki("example", {
* projectId: example.id,
* name: "Example project wiki ",
* type: "projectWiki",
* });
* const exampleWikiPage = new azuredevops.WikiPage("example", {
* projectId: example.id,
* wikiId: exampleWiki.id,
* path: "/page",
* content: "content",
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.1 - Wiki Page](https://learn.microsoft.com/en-us/rest/api/azure/devops/wiki/pages?view=azure-devops-rest-7.1)
*/
class WikiPage extends pulumi.CustomResource {
/**
* Get an existing WikiPage resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new WikiPage(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of WikiPage. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === WikiPage.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["content"] = state?.content;
resourceInputs["etag"] = state?.etag;
resourceInputs["path"] = state?.path;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["wikiId"] = state?.wikiId;
}
else {
const args = argsOrState;
if (args?.content === undefined && !opts.urn) {
throw new Error("Missing required property 'content'");
}
if (args?.path === undefined && !opts.urn) {
throw new Error("Missing required property 'path'");
}
if (args?.projectId === undefined && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if (args?.wikiId === undefined && !opts.urn) {
throw new Error("Missing required property 'wikiId'");
}
resourceInputs["content"] = args?.content;
resourceInputs["etag"] = args?.etag;
resourceInputs["path"] = args?.path;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["wikiId"] = args?.wikiId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(WikiPage.__pulumiType, name, resourceInputs, opts);
}
}
exports.WikiPage = WikiPage;
/** @internal */
WikiPage.__pulumiType = 'azuredevops:index/wikiPage:WikiPage';
//# sourceMappingURL=wikiPage.js.map