DocumentationPart class

Provides a settings of an API Gateway Documentation Part.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleRestApi = new aws.apigateway.RestApi("example", {name: "example_api"});
const example = new aws.apigateway.DocumentationPart("example", {
    location: {
        type: "METHOD",
        method: "GET",
        path: "/example",
    },
    properties: "{\"description\":\"Example description\"}",
    restApiId: exampleRestApi.id,
});
import pulumi
import pulumi_aws as aws

example_rest_api = aws.apigateway.RestApi("example", name="example_api")
example = aws.apigateway.DocumentationPart("example",
    location={
        "type": "METHOD",
        "method": "GET",
        "path": "/example",
    },
    properties="{\"description\":\"Example description\"}",
    rest_api_id=example_rest_api.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var exampleRestApi = new Aws.ApiGateway.RestApi("example", new()
    {
        Name = "example_api",
    });

    var example = new Aws.ApiGateway.DocumentationPart("example", new()
    {
        Location = new Aws.ApiGateway.Inputs.DocumentationPartLocationArgs
        {
            Type = "METHOD",
            Method = "GET",
            Path = "/example",
        },
        Properties = "{\"description\":\"Example description\"}",
        RestApiId = exampleRestApi.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/apigateway"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleRestApi, err := apigateway.NewRestApi(ctx, "example", &apigateway.RestApiArgs{
			Name: pulumi.String("example_api"),
		})
		if err != nil {
			return err
		}
		_, err = apigateway.NewDocumentationPart(ctx, "example", &apigateway.DocumentationPartArgs{
			Location: &apigateway.DocumentationPartLocationArgs{
				Type:   pulumi.String("METHOD"),
				Method: pulumi.String("GET"),
				Path:   pulumi.String("/example"),
			},
			Properties: pulumi.String("{\"description\":\"Example description\"}"),
			RestApiId:  exampleRestApi.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_apigateway_documentationpart" "example" {
  location = {
    type   = "METHOD"
    method = "GET"
    path   = "/example"
  }
  properties  = "{\"description\":\"Example description\"}"
  rest_api_id = aws_apigateway_restapi.example.id
}
resource "aws_apigateway_restapi" "example" {
  name = "example_api"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.RestApi;
import com.pulumi.aws.apigateway.RestApiArgs;
import com.pulumi.aws.apigateway.DocumentationPart;
import com.pulumi.aws.apigateway.DocumentationPartArgs;
import com.pulumi.aws.apigateway.inputs.DocumentationPartLocationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleRestApi = new RestApi("exampleRestApi", RestApiArgs.builder()
            .name("example_api")
            .build());

        var example = new DocumentationPart("example", DocumentationPartArgs.builder()
            .location(DocumentationPartLocationArgs.builder()
                .type("METHOD")
                .method("GET")
                .path("/example")
                .build())
            .properties("{\"description\":\"Example description\"}")
            .restApiId(exampleRestApi.id())
            .build());

    }
}
resources:
  example:
    type: aws:apigateway:DocumentationPart
    properties:
      location:
        type: METHOD
        method: GET
        path: /example
      properties: '{"description":"Example description"}'
      restApiId: ${exampleRestApi.id}
  exampleRestApi:
    type: aws:apigateway:RestApi
    name: example
    properties:
      name: example_api

Import

Using pulumi import, import API Gateway documentationParts using REST-API-ID/DOC-PART-ID. For example:

$ pulumi import aws:apigateway/documentationPart:DocumentationPart example 5i4e1ko720/3oyy3t

Constructors

DocumentationPart(String name, {DocumentationPartArgs? args, CustomResourceOptions? options})
Creates a new DocumentationPart. name The Pulumi resource name. args Arguments used to configure this DocumentationPart. The set of arguments for DocumentationPart. options Resource options controlling this resource's behavior.
DocumentationPart.reference(String urn)
Creates a typed reference to an existing DocumentationPart resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
documentationPartId ↔ Output<String>
DocumentationPart identifier, generated by API Gateway when the documentation part is created.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
location ↔ Output<DocumentationPartLocation>
Location of the targeted API entity of the to-be-created documentation part. See below.
latefinal
properties ↔ Output<String>
Content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ "description": "The API does ..." }". Only Swagger-compliant key-value pairs can be exported and, hence, published.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
restApiId ↔ Output<String>
ID of the associated Rest API
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {DocumentationPartState? state, CustomResourceOptions? options}) → DocumentationPart
Gets an existing DocumentationPart resource's state with the given name and id.