5758 for C#/.NET (#7899)

* Rebase 5758 .NET work and make output-funcs pass

* Propagate changes to the other examples

* CHANGELOG

* Address PR feedback

* Add a test reproducing aws-native compilation failure

* Fix dangling type ref issue in the .NET backend for codegen

* Accept changes and unskip simple-methods-schema compile check

* Accept changes in node, python, go codegen

* SDK changes to enable a better implementation approach

* Switch approach to support functions like GetAmiIds; avoid name conflicts under tfbridge20

* Make all dotnet tests pass, mechanical fixes + accept test output

* Accept python changes

* Accept node output

* Accept docs changes

* Deepen the unit test to cover the interesting helper type

* Accept go changes and fixup tests

* Implement dep propagation through Invoke

* Fixup cyclic-types

* Accept codegen

* NOTE we now require .NET SDK 3.15 or higher
This commit is contained in:
Anton Tayanovskyy 2021-10-18 18:18:15 -04:00 committed by GitHub
parent 5f70bccaca
commit e710125885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 2371 additions and 68 deletions

View file

@ -1,4 +1,13 @@
### Improvements
- [codegen/dotnet] - Add helper function forms `$fn.Invoke` that
accept `Input`s, return an `Output`, and wrap the underlying
`$fn.InvokeAsync` call. This change addreses
[#5758](https://github.com/pulumi/pulumi/issues/) for .NET, making
it easier to compose functions/datasources with Pulumi resources.
NOTE for resource providers: the generated code requires Pulumi .NET
SDK 3.15 or higher.
[#7899](https://github.com/pulumi/pulumi/pull/7899)
### Bug Fixes

View file

@ -1,4 +1,4 @@
// Copyright 2016-2020, Pulumi Corporation.
// Copyright 2016-2021, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -52,10 +52,11 @@ func (ss stringSet) has(s string) bool {
}
type typeDetails struct {
outputType bool
inputType bool
stateType bool
plainType bool
outputType bool
inputType bool
stateType bool
plainType bool
usedInFunctionOutputVersionInputs bool
}
// Title converts the input string to a title case
@ -229,6 +230,8 @@ func (mod *modContext) typeName(t *schema.ObjectType, state, input, args bool) s
}
switch {
case input && args && mod.details(t).usedInFunctionOutputVersionInputs:
return name + "InputArgs"
case input:
return name + "Args"
case mod.details(t).plainType:
@ -493,12 +496,8 @@ type plainType struct {
internal bool
}
func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent string) {
func (pt *plainType) genInputPropertyAttribute(w io.Writer, indent string, prop *schema.Property) {
wireName := prop.Name
propertyName := pt.mod.propertyName(prop)
propertyType := pt.mod.typeString(prop.Type, pt.propertyTypeQualifier, true, pt.state, false)
// First generate the input attribute.
attributeArgs := ""
if prop.IsRequired() {
attributeArgs = ", required: true"
@ -515,6 +514,12 @@ func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent
attributeArgs += ", json: true"
}
}
fmt.Fprintf(w, "%s[Input(\"%s\"%s)]\n", indent, wireName, attributeArgs)
}
func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent string, generateInputAttribute bool) {
propertyName := pt.mod.propertyName(prop)
propertyType := pt.mod.typeString(prop.Type, pt.propertyTypeQualifier, true, pt.state, false)
indent = strings.Repeat(indent, 2)
@ -536,7 +541,10 @@ func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent
requireInitializers := !pt.args || !isInputType(prop.Type)
backingFieldType := pt.mod.typeString(codegen.RequiredType(prop), pt.propertyTypeQualifier, true, pt.state, requireInitializers)
fmt.Fprintf(w, "%s[Input(\"%s\"%s)]\n", indent, wireName, attributeArgs)
if generateInputAttribute {
pt.genInputPropertyAttribute(w, indent, prop)
}
fmt.Fprintf(w, "%sprivate %s? %s;\n", indent, backingFieldType, backingFieldName)
if prop.Comment != "" {
@ -587,7 +595,11 @@ func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent
}
printComment(w, prop.Comment, indent)
fmt.Fprintf(w, "%s[Input(\"%s\"%s)]\n", indent, wireName, attributeArgs)
if generateInputAttribute {
pt.genInputPropertyAttribute(w, indent, prop)
}
fmt.Fprintf(w, "%spublic %s %s { get; set; }%s\n", indent, propertyType, propertyName, initializer)
}
}
@ -596,6 +608,10 @@ func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent
var generatedTypes = codegen.Set{}
func (pt *plainType) genInputType(w io.Writer, level int) error {
return pt.genInputTypeWithFlags(w, level, true /* generateInputAttributes */)
}
func (pt *plainType) genInputTypeWithFlags(w io.Writer, level int, generateInputAttributes bool) error {
// The way the legacy codegen for kubernetes is structured, inputs for a resource args type and resource args
// subtype could become a single class because of the name + namespace clash. We use a set of generated types
// to prevent generating classes with equal full names in multiple files. The check should be removed if we
@ -619,12 +635,18 @@ func (pt *plainType) genInputType(w io.Writer, level int) error {
// Open the class.
printCommentWithOptions(w, pt.comment, indent, !pt.unescapeComment)
fmt.Fprintf(w, "%spublic %sclass %s : Pulumi.%s\n", indent, sealed, pt.name, pt.baseClass)
var suffix string
if pt.baseClass != "" {
suffix = fmt.Sprintf(" : Pulumi.%s", pt.baseClass)
}
fmt.Fprintf(w, "%spublic %sclass %s%s\n", indent, sealed, pt.name, suffix)
fmt.Fprintf(w, "%s{\n", indent)
// Declare each input property.
for _, p := range pt.properties {
pt.genInputProperty(w, p, indent)
pt.genInputProperty(w, p, indent, generateInputAttributes)
fmt.Fprintf(w, "\n")
}
@ -1253,6 +1275,35 @@ func (mod *modContext) genResource(w io.Writer, r *schema.Resource) error {
return nil
}
func (mod *modContext) genFunctionFileCode(f *schema.Function) (string, error) {
imports := map[string]codegen.StringSet{}
mod.getImports(f, imports)
buffer := &bytes.Buffer{}
importStrings := pulumiImports
for _, i := range imports {
importStrings = append(importStrings, i.SortedValues()...)
}
if f.NeedsOutputVersion() {
importStrings = append(importStrings, "Pulumi.Utilities")
}
mod.genHeader(buffer, importStrings)
if err := mod.genFunction(buffer, f); err != nil {
return "", err
}
return buffer.String(), nil
}
func allOptionalInputs(fun *schema.Function) bool {
if fun.Inputs != nil {
for _, prop := range fun.Inputs.Properties {
if prop.IsRequired() {
return false
}
}
}
return true
}
func (mod *modContext) genFunction(w io.Writer, fun *schema.Function) error {
className := tokenToFunctionName(fun.Token)
@ -1267,13 +1318,8 @@ func (mod *modContext) genFunction(w io.Writer, fun *schema.Function) error {
var argsParamDef string
argsParamRef := "InvokeArgs.Empty"
if fun.Inputs != nil {
allOptionalInputs := true
for _, prop := range fun.Inputs.Properties {
allOptionalInputs = allOptionalInputs && !prop.IsRequired()
}
var argsDefault, sigil string
if allOptionalInputs {
if allOptionalInputs(fun) {
// If the number of required input properties was zero, we can make the args object optional.
argsDefault, sigil = " = null", "?"
}
@ -1298,6 +1344,12 @@ func (mod *modContext) genFunction(w io.Writer, fun *schema.Function) error {
fmt.Fprintf(w, " => Pulumi.Deployment.Instance.InvokeAsync%s(\"%s\", %s, options.WithVersion());\n",
typeParameter, fun.Token, argsParamRef)
// Emit the Output method if needed.
err := mod.genFunctionOutputVersion(w, fun)
if err != nil {
return err
}
// Close the class.
fmt.Fprintf(w, " }\n")
@ -1316,6 +1368,12 @@ func (mod *modContext) genFunction(w io.Writer, fun *schema.Function) error {
return err
}
}
err = mod.genFunctionOutputVersionTypes(w, fun)
if err != nil {
return err
}
if fun.Outputs != nil {
fmt.Fprintf(w, "\n")
@ -1333,6 +1391,61 @@ func (mod *modContext) genFunction(w io.Writer, fun *schema.Function) error {
return nil
}
func functionOutputVersionArgsTypeName(fun *schema.Function) string {
className := tokenToFunctionName(fun.Token)
return fmt.Sprintf("%sInvokeArgs", className)
}
// Generates `${fn}Output(..)` version lifted to work on
// `Input`-wrapped arguments and producing an `Output`-wrapped result.
func (mod *modContext) genFunctionOutputVersion(w io.Writer, fun *schema.Function) error {
if !fun.NeedsOutputVersion() {
return nil
}
className := tokenToFunctionName(fun.Token)
var argsDefault, sigil string
if allOptionalInputs(fun) {
// If the number of required input properties was zero, we can make the args object optional.
argsDefault, sigil = " = null", "?"
}
argsTypeName := functionOutputVersionArgsTypeName(fun)
outputArgsParamDef := fmt.Sprintf("%s%s args%s, ", argsTypeName, sigil, argsDefault)
outputArgsParamRef := fmt.Sprintf("args ?? new %s()", argsTypeName)
fmt.Fprintf(w, "\n")
// Emit the doc comment, if any.
printComment(w, fun.Comment, " ")
fmt.Fprintf(w, " public static Output<%sResult> Invoke(%sInvokeOptions? options = null)\n",
className, outputArgsParamDef)
fmt.Fprintf(w, " => Pulumi.Deployment.Instance.Invoke<%sResult>(\"%s\", %s, options.WithVersion());\n",
className, fun.Token, outputArgsParamRef)
return nil
}
// Generate helper type definitions referred to in `genFunctionOutputVersion`.
func (mod *modContext) genFunctionOutputVersionTypes(w io.Writer, fun *schema.Function) error {
if !fun.NeedsOutputVersion() || fun.Inputs == nil {
return nil
}
applyArgs := &plainType{
mod: mod,
name: functionOutputVersionArgsTypeName(fun),
propertyTypeQualifier: "Inputs",
baseClass: "InvokeArgs",
properties: fun.Inputs.InputShape.Properties,
args: true,
}
if err := applyArgs.genInputTypeWithFlags(w, 1, true /* generateInputAttributes */); err != nil {
return err
}
return nil
}
func (mod *modContext) genEnums(w io.Writer, enums []*schema.EnumType) error {
// Open the namespace.
fmt.Fprintf(w, "namespace %s\n", mod.namespaceName)
@ -1904,21 +2017,11 @@ func (mod *modContext) gen(fs fs) error {
// Functions
for _, f := range mod.functions {
imports := map[string]codegen.StringSet{}
mod.getImports(f, imports)
buffer := &bytes.Buffer{}
importStrings := pulumiImports
for _, i := range imports {
importStrings = append(importStrings, i.SortedValues()...)
}
mod.genHeader(buffer, importStrings)
if err := mod.genFunction(buffer, f); err != nil {
code, err := mod.genFunctionFileCode(f)
if err != nil {
return err
}
addFile(tokenToName(f.Token)+".cs", buffer.String())
addFile(tokenToName(f.Token)+".cs", code)
}
// Nested types
@ -1952,7 +2055,6 @@ func (mod *modContext) gen(fs fs) error {
return err
}
fmt.Fprintf(buffer, "}\n")
addFile(path.Join("Inputs", tokenToName(t.Token)+"GetArgs.cs"), buffer.String())
}
if mod.details(t).outputType {
@ -1970,7 +2072,6 @@ func (mod *modContext) gen(fs fs) error {
if (mod.isTFCompatMode() || mod.isK8sCompatMode()) && mod.details(t).plainType {
suffix = "Result"
}
addFile(path.Join("Outputs", tokenToName(t.Token)+suffix+".cs"), buffer.String())
}
}
@ -1990,8 +2091,13 @@ func (mod *modContext) gen(fs fs) error {
}
// genPackageMetadata generates all the non-code metadata required by a Pulumi package.
func genPackageMetadata(pkg *schema.Package, assemblyName string, packageReferences map[string]string, files fs) error {
projectFile, err := genProjectFile(pkg, assemblyName, packageReferences)
func genPackageMetadata(pkg *schema.Package,
assemblyName string,
packageReferences map[string]string,
projectReferences []string,
files fs) error {
projectFile, err := genProjectFile(pkg, assemblyName, packageReferences, projectReferences)
if err != nil {
return err
}
@ -2006,12 +2112,17 @@ func genPackageMetadata(pkg *schema.Package, assemblyName string, packageReferen
}
// genProjectFile emits a C# project file into the configured output directory.
func genProjectFile(pkg *schema.Package, assemblyName string, packageReferences map[string]string) ([]byte, error) {
func genProjectFile(pkg *schema.Package,
assemblyName string,
packageReferences map[string]string,
projectReferences []string) ([]byte, error) {
w := &bytes.Buffer{}
err := csharpProjectFileTemplate.Execute(w, csharpProjectFileTemplateContext{
XMLDoc: fmt.Sprintf(`.\%s.xml`, assemblyName),
Package: pkg,
PackageReferences: packageReferences,
ProjectReferences: projectReferences,
})
if err != nil {
return nil, err
@ -2188,6 +2299,13 @@ func generateModuleContextMap(tool string, pkg *schema.Package) (map[string]*mod
details.inputType = true
details.plainType = true
})
if f.NeedsOutputVersion() {
visitObjectTypes(f.Inputs.InputShape.Properties, func(t *schema.ObjectType) {
details := getModFromToken(t.Token, t.Package).details(t)
details.inputType = true
details.usedInFunctionOutputVersionInputs = true
})
}
}
if f.Outputs != nil {
visitObjectTypes(f.Outputs.Properties, func(t *schema.ObjectType) {
@ -2262,7 +2380,12 @@ func GeneratePackage(tool string, pkg *schema.Package, extraFiles map[string][]b
}
// Finally emit the package metadata.
if err := genPackageMetadata(pkg, assemblyName, info.PackageReferences, files); err != nil {
if err := genPackageMetadata(pkg,
assemblyName,
info.PackageReferences,
info.ProjectReferences,
files); err != nil {
return nil, err
}
return files, nil

View file

@ -10,9 +10,6 @@ import (
"github.com/pulumi/pulumi/pkg/v3/codegen/internal/test"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/executable"
)
func TestGeneratePackage(t *testing.T) {
@ -21,22 +18,21 @@ func TestGeneratePackage(t *testing.T) {
GenPackage: GeneratePackage,
Checks: map[string]test.CodegenCheck{
"dotnet/compile": typeCheckGeneratedPackage,
"dotnet/test": testGeneratedPackage,
},
})
}
func typeCheckGeneratedPackage(t *testing.T, pwd string) {
var err error
var dotnet string
dotnet, err = executable.FindExecutable("dotnet")
require.NoError(t, err)
cmdOptions := integration.ProgramTestOptions{}
versionPath := filepath.Join(pwd, "version.txt")
err = os.WriteFile(versionPath, []byte("0.0.0\n"), 0600)
defer func() { contract.IgnoreError(os.Remove(versionPath)) }()
require.NoError(t, err)
err = integration.RunCommand(t, "dotnet build", []string{dotnet, "build"}, pwd, &cmdOptions)
err := os.WriteFile(versionPath, []byte("0.0.0\n"), 0600)
require.NoError(t, err)
test.RunCommand(t, "dotnet build", pwd, "dotnet", "build")
}
func testGeneratedPackage(t *testing.T, pwd string) {
test.RunCommand(t, "dotnet build", pwd, "dotnet", "test")
}
func TestGenerateType(t *testing.T) {

View file

@ -31,7 +31,7 @@ type CSharpPackageInfo struct {
Namespaces map[string]string `json:"namespaces,omitempty"`
Compatibility string `json:"compatibility,omitempty"`
DictionaryConstructors bool `json:"dictionaryConstructors,omitempty"`
ProjectReferences []string `json:"projectReferences,omitempty"`
// Determines whether to make single-return-value methods return an output object or the single value.
LiftSingleValueMethodReturns bool `json:"liftSingleValueMethodReturns,omitempty"`
}

View file

@ -169,6 +169,12 @@ const csharpProjectFileTemplateText = `<Project Sdk="Microsoft.NET.Sdk">
{{- end}}
</ItemGroup>
<ItemGroup>
{{- range $projdir := .ProjectReferences}}
<ProjectReference Include="{{$projdir}}" />
{{- end}}
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>
@ -194,5 +200,6 @@ type csharpProjectFileTemplateContext struct {
XMLDoc string
Package *schema.Package
PackageReferences map[string]string
ProjectReferences []string
Version string
}

View file

@ -117,7 +117,7 @@ var sdkTests = []sdkTest{
{
Directory: "simple-methods-schema",
Description: "Simple schema with methods",
SkipCompileCheck: codegen.NewStringSet(nodejs, dotnet, golang),
SkipCompileCheck: codegen.NewStringSet(nodejs, golang),
Skip: codegen.NewStringSet("python/test", "nodejs/test"),
},
{

View file

@ -6,5 +6,6 @@ go.mod
*/python/venv
*/python/*.egg-info
*/python/requirements.txt
*/nodejs/tests
*/dotnet/Tests
*/dotnet/version.txt
*/nodejs/tests

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -46,6 +46,9 @@
<PackageReference Include="Pulumi.Random" Version="4.2" ExcludeAssets="contentFiles" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Example
{
@ -13,6 +14,9 @@ namespace Pulumi.Example
{
public static Task<ArgFunctionResult> InvokeAsync(ArgFunctionArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionArgs(), options.WithVersion());
public static Output<ArgFunctionResult> Invoke(ArgFunctionInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionInvokeArgs(), options.WithVersion());
}
@ -26,6 +30,16 @@ namespace Pulumi.Example
}
}
public sealed class ArgFunctionInvokeArgs : Pulumi.InvokeArgs
{
[Input("name")]
public Input<Pulumi.Random.RandomPet>? Name { get; set; }
public ArgFunctionInvokeArgs()
{
}
}
[OutputType]
public sealed class ArgFunctionResult

View file

@ -40,12 +40,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.12" />
<PackageReference Include="Pulumi" Version="3.13" />
<PackageReference Include="Pulumi.Aws" Version="4.20" ExcludeAssets="contentFiles" />
<PackageReference Include="Pulumi.Kubernetes" Version="3.7.0" ExcludeAssets="contentFiles" />
<PackageReference Include="Pulumi.Random" Version="4.2.0" ExcludeAssets="contentFiles" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\..\sdk\dotnet\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -142,8 +142,11 @@
},
"language": {
"csharp": {
"projectReferences": [
"..\\..\\..\\..\\..\\..\\..\\sdk\\dotnet\\Pulumi\\Pulumi.csproj"
],
"packageReferences": {
"Pulumi": "3.12",
"Pulumi": "3.13",
"Pulumi.Aws": "4.20",
"Pulumi.Kubernetes": "3.7.0",
"Pulumi.Random": "4.2.0"

View file

@ -44,6 +44,9 @@
<PackageReference Include="Pulumi.AzureNative" Version="1.28.*" ExcludeAssets="contentFiles" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.*" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -0,0 +1,40 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Myedgeorder.Inputs
{
/// <summary>
/// Configuration filters
/// </summary>
public sealed class ConfigurationFiltersArgs : Pulumi.ResourceArgs
{
[Input("filterableProperty")]
private InputList<Inputs.FilterablePropertyArgs>? _filterableProperty;
/// <summary>
/// Filters specific to product
/// </summary>
public InputList<Inputs.FilterablePropertyArgs> FilterableProperty
{
get => _filterableProperty ?? (_filterableProperty = new InputList<Inputs.FilterablePropertyArgs>());
set => _filterableProperty = value;
}
/// <summary>
/// Product hierarchy information
/// </summary>
[Input("hierarchyInformation", required: true)]
public Input<Inputs.HierarchyInformationArgs> HierarchyInformation { get; set; } = null!;
public ConfigurationFiltersArgs()
{
}
}
}

View file

@ -0,0 +1,46 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Myedgeorder.Inputs
{
/// <summary>
/// Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details
/// </summary>
public sealed class CustomerSubscriptionDetailsArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Location placement Id of a subscription
/// </summary>
[Input("locationPlacementId")]
public Input<string>? LocationPlacementId { get; set; }
/// <summary>
/// Quota ID of a subscription
/// </summary>
[Input("quotaId", required: true)]
public Input<string> QuotaId { get; set; } = null!;
[Input("registeredFeatures")]
private InputList<Inputs.CustomerSubscriptionRegisteredFeaturesArgs>? _registeredFeatures;
/// <summary>
/// List of registered feature flags for subscription
/// </summary>
public InputList<Inputs.CustomerSubscriptionRegisteredFeaturesArgs> RegisteredFeatures
{
get => _registeredFeatures ?? (_registeredFeatures = new InputList<Inputs.CustomerSubscriptionRegisteredFeaturesArgs>());
set => _registeredFeatures = value;
}
public CustomerSubscriptionDetailsArgs()
{
}
}
}

View file

@ -0,0 +1,34 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Myedgeorder.Inputs
{
/// <summary>
/// Represents subscription registered features
/// </summary>
public sealed class CustomerSubscriptionRegisteredFeaturesArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Name of subscription registered feature
/// </summary>
[Input("name")]
public Input<string>? Name { get; set; }
/// <summary>
/// State of subscription registered feature
/// </summary>
[Input("state")]
public Input<string>? State { get; set; }
public CustomerSubscriptionRegisteredFeaturesArgs()
{
}
}
}

View file

@ -0,0 +1,40 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Myedgeorder.Inputs
{
/// <summary>
/// Different types of filters supported and its values.
/// </summary>
public sealed class FilterablePropertyArgs : Pulumi.ResourceArgs
{
[Input("supportedValues", required: true)]
private InputList<string>? _supportedValues;
/// <summary>
/// Values to be filtered.
/// </summary>
public InputList<string> SupportedValues
{
get => _supportedValues ?? (_supportedValues = new InputList<string>());
set => _supportedValues = value;
}
/// <summary>
/// Type of product filter.
/// </summary>
[Input("type", required: true)]
public InputUnion<string, Pulumi.Myedgeorder.SupportedFilterTypes> Type { get; set; } = null!;
public FilterablePropertyArgs()
{
}
}
}

View file

@ -0,0 +1,46 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Myedgeorder.Inputs
{
/// <summary>
/// Holds details about product hierarchy information
/// </summary>
public sealed class HierarchyInformationArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Represents configuration name that uniquely identifies configuration
/// </summary>
[Input("configurationName")]
public Input<string>? ConfigurationName { get; set; }
/// <summary>
/// Represents product family name that uniquely identifies product family
/// </summary>
[Input("productFamilyName")]
public Input<string>? ProductFamilyName { get; set; }
/// <summary>
/// Represents product line name that uniquely identifies product line
/// </summary>
[Input("productLineName")]
public Input<string>? ProductLineName { get; set; }
/// <summary>
/// Represents product name that uniquely identifies product
/// </summary>
[Input("productName")]
public Input<string>? ProductName { get; set; }
public HierarchyInformationArgs()
{
}
}
}

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Myedgeorder
{
@ -17,6 +18,13 @@ namespace Pulumi.Myedgeorder
/// </summary>
public static Task<ListConfigurationsResult> InvokeAsync(ListConfigurationsArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ListConfigurationsResult>("myedgeorder::listConfigurations", args ?? new ListConfigurationsArgs(), options.WithVersion());
/// <summary>
/// The list of configurations.
/// API Version: 2020-12-01-preview.
/// </summary>
public static Output<ListConfigurationsResult> Invoke(ListConfigurationsInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ListConfigurationsResult>("myedgeorder::listConfigurations", args ?? new ListConfigurationsInvokeArgs(), options.WithVersion());
}
@ -51,6 +59,37 @@ namespace Pulumi.Myedgeorder
}
}
public sealed class ListConfigurationsInvokeArgs : Pulumi.InvokeArgs
{
[Input("configurationFilters", required: true)]
private InputList<Inputs.ConfigurationFiltersArgs>? _configurationFilters;
/// <summary>
/// Holds details about product hierarchy information and filterable property.
/// </summary>
public InputList<Inputs.ConfigurationFiltersArgs> ConfigurationFilters
{
get => _configurationFilters ?? (_configurationFilters = new InputList<Inputs.ConfigurationFiltersArgs>());
set => _configurationFilters = value;
}
/// <summary>
/// Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details
/// </summary>
[Input("customerSubscriptionDetails")]
public Input<Inputs.CustomerSubscriptionDetailsArgs>? CustomerSubscriptionDetails { get; set; }
/// <summary>
/// $skipToken is supported on list of configurations, which provides the next page in the list of configurations.
/// </summary>
[Input("skipToken")]
public Input<string>? SkipToken { get; set; }
public ListConfigurationsInvokeArgs()
{
}
}
[OutputType]
public sealed class ListConfigurationsResult

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Myedgeorder
{
@ -17,6 +18,13 @@ namespace Pulumi.Myedgeorder
/// </summary>
public static Task<ListProductFamiliesResult> InvokeAsync(ListProductFamiliesArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ListProductFamiliesResult>("myedgeorder::listProductFamilies", args ?? new ListProductFamiliesArgs(), options.WithVersion());
/// <summary>
/// The list of product families.
/// API Version: 2020-12-01-preview.
/// </summary>
public static Output<ListProductFamiliesResult> Invoke(ListProductFamiliesInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ListProductFamiliesResult>("myedgeorder::listProductFamilies", args ?? new ListProductFamiliesInvokeArgs(), options.WithVersion());
}
@ -57,6 +65,43 @@ namespace Pulumi.Myedgeorder
}
}
public sealed class ListProductFamiliesInvokeArgs : Pulumi.InvokeArgs
{
/// <summary>
/// Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details
/// </summary>
[Input("customerSubscriptionDetails")]
public Input<Inputs.CustomerSubscriptionDetailsArgs>? CustomerSubscriptionDetails { get; set; }
/// <summary>
/// $expand is supported on configurations parameter for product, which provides details on the configurations for the product.
/// </summary>
[Input("expand")]
public Input<string>? Expand { get; set; }
[Input("filterableProperties", required: true)]
private InputMap<ImmutableArray<Inputs.FilterablePropertyArgs>>? _filterableProperties;
/// <summary>
/// Dictionary of filterable properties on product family.
/// </summary>
public InputMap<ImmutableArray<Inputs.FilterablePropertyArgs>> FilterableProperties
{
get => _filterableProperties ?? (_filterableProperties = new InputMap<ImmutableArray<Inputs.FilterablePropertyArgs>>());
set => _filterableProperties = value;
}
/// <summary>
/// $skipToken is supported on list of product families, which provides the next page in the list of product families.
/// </summary>
[Input("skipToken")]
public Input<string>? SkipToken { get; set; }
public ListProductFamiliesInvokeArgs()
{
}
}
[OutputType]
public sealed class ListProductFamiliesResult

View file

@ -42,6 +42,9 @@
<ItemGroup>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -2,10 +2,15 @@
"emittedFiles": [
"Enums.cs",
"Inputs/ConfigurationFilters.cs",
"Inputs/ConfigurationFiltersArgs.cs",
"Inputs/CustomerSubscriptionDetails.cs",
"Inputs/CustomerSubscriptionDetailsArgs.cs",
"Inputs/CustomerSubscriptionRegisteredFeatures.cs",
"Inputs/CustomerSubscriptionRegisteredFeaturesArgs.cs",
"Inputs/FilterableProperty.cs",
"Inputs/FilterablePropertyArgs.cs",
"Inputs/HierarchyInformation.cs",
"Inputs/HierarchyInformationArgs.cs",
"ListConfigurations.cs",
"ListProductFamilies.cs",
"Outputs/AvailabilityInformationResponse.cs",

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -17,6 +18,12 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<GetAmiIdsResult> InvokeAsync(GetAmiIdsArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetAmiIdsResult>("mypkg::getAmiIds", args ?? new GetAmiIdsArgs(), options.WithVersion());
/// <summary>
/// Taken from pulumi-AWS to regress an issue
/// </summary>
public static Output<GetAmiIdsResult> Invoke(GetAmiIdsInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<GetAmiIdsResult>("mypkg::getAmiIds", args ?? new GetAmiIdsInvokeArgs(), options.WithVersion());
}
@ -82,6 +89,68 @@ namespace Pulumi.Mypkg
}
}
public sealed class GetAmiIdsInvokeArgs : Pulumi.InvokeArgs
{
[Input("executableUsers")]
private InputList<string>? _executableUsers;
/// <summary>
/// Limit search to users with *explicit* launch
/// permission on the image. Valid items are the numeric account ID or `self`.
/// </summary>
public InputList<string> ExecutableUsers
{
get => _executableUsers ?? (_executableUsers = new InputList<string>());
set => _executableUsers = value;
}
[Input("filters")]
private InputList<Inputs.GetAmiIdsFilterInputArgs>? _filters;
/// <summary>
/// One or more name/value pairs to filter off of. There
/// are several valid keys, for a full reference, check out
/// [describe-images in the AWS CLI reference][1].
/// </summary>
public InputList<Inputs.GetAmiIdsFilterInputArgs> Filters
{
get => _filters ?? (_filters = new InputList<Inputs.GetAmiIdsFilterInputArgs>());
set => _filters = value;
}
/// <summary>
/// A regex string to apply to the AMI list returned
/// by AWS. This allows more advanced filtering not supported from the AWS API.
/// This filtering is done locally on what AWS returns, and could have a performance
/// impact if the result is large. It is recommended to combine this with other
/// options to narrow down the list AWS returns.
/// </summary>
[Input("nameRegex")]
public Input<string>? NameRegex { get; set; }
[Input("owners", required: true)]
private InputList<string>? _owners;
/// <summary>
/// List of AMI owners to limit search. At least 1 value must be specified. Valid values: an AWS account ID, `self` (the current account), or an AWS owner alias (e.g. `amazon`, `aws-marketplace`, `microsoft`).
/// </summary>
public InputList<string> Owners
{
get => _owners ?? (_owners = new InputList<string>());
set => _owners = value;
}
/// <summary>
/// Used to sort AMIs by creation time.
/// </summary>
[Input("sortAscending")]
public Input<bool>? SortAscending { get; set; }
public GetAmiIdsInvokeArgs()
{
}
}
[OutputType]
public sealed class GetAmiIdsResult

View file

@ -0,0 +1,30 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Mypkg.Inputs
{
public sealed class GetAmiIdsFilterInputArgs : Pulumi.ResourceArgs
{
[Input("name", required: true)]
public Input<string> Name { get; set; } = null!;
[Input("values", required: true)]
private InputList<string>? _values;
public InputList<string> Values
{
get => _values ?? (_values = new InputList<string>());
set => _values = value;
}
public GetAmiIdsFilterInputArgs()
{
}
}
}

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -17,6 +18,13 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<ListStorageAccountKeysResult> InvokeAsync(ListStorageAccountKeysArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ListStorageAccountKeysResult>("mypkg::listStorageAccountKeys", args ?? new ListStorageAccountKeysArgs(), options.WithVersion());
/// <summary>
/// The response from the ListKeys operation.
/// API Version: 2021-02-01.
/// </summary>
public static Output<ListStorageAccountKeysResult> Invoke(ListStorageAccountKeysInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ListStorageAccountKeysResult>("mypkg::listStorageAccountKeys", args ?? new ListStorageAccountKeysInvokeArgs(), options.WithVersion());
}
@ -45,6 +53,31 @@ namespace Pulumi.Mypkg
}
}
public sealed class ListStorageAccountKeysInvokeArgs : Pulumi.InvokeArgs
{
/// <summary>
/// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
/// </summary>
[Input("accountName", required: true)]
public Input<string> AccountName { get; set; } = null!;
/// <summary>
/// Specifies type of the key to be listed. Possible value is kerb.
/// </summary>
[Input("expand")]
public Input<string>? Expand { get; set; }
/// <summary>
/// The name of the resource group within the user's subscription. The name is case insensitive.
/// </summary>
[Input("resourceGroupName", required: true)]
public Input<string> ResourceGroupName { get; set; } = null!;
public ListStorageAccountKeysInvokeArgs()
{
}
}
[OutputType]
public sealed class ListStorageAccountKeysResult

View file

@ -47,6 +47,10 @@
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\..\sdk\dotnet\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -2,6 +2,7 @@
"emittedFiles": [
"GetAmiIds.cs",
"Inputs/GetAmiIdsFilter.cs",
"Inputs/GetAmiIdsFilterArgs.cs",
"ListStorageAccountKeys.cs",
"Outputs/GetAmiIdsFilterResult.cs",
"Outputs/StorageAccountKeyResponseResult.cs",

View file

@ -23,6 +23,7 @@ no_edit_this_page: true
<li><a href="funcwithdefaultvalue" title="FuncWithDefaultValue"><span class="api-symbol api-symbol--function"></span>FuncWithDefaultValue</a></li>
<li><a href="funcwithdictparam" title="FuncWithDictParam"><span class="api-symbol api-symbol--function"></span>FuncWithDictParam</a></li>
<li><a href="funcwithlistparam" title="FuncWithListParam"><span class="api-symbol api-symbol--function"></span>FuncWithListParam</a></li>
<li><a href="getbastionshareablelink" title="GetBastionShareableLink"><span class="api-symbol api-symbol--function"></span>GetBastionShareableLink</a></li>
<li><a href="getclientconfig" title="GetClientConfig"><span class="api-symbol api-symbol--function"></span>GetClientConfig</a></li>
<li><a href="getintegrationruntimeobjectmetadatum" title="GetIntegrationRuntimeObjectMetadatum"><span class="api-symbol api-symbol--function"></span>GetIntegrationRuntimeObjectMetadatum</a></li>
<li><a href="liststorageaccountkeys" title="ListStorageAccountKeys"><span class="api-symbol api-symbol--function"></span>ListStorageAccountKeys</a></li>

View file

@ -6,6 +6,7 @@
"funcwithdefaultvalue/_index.md",
"funcwithdictparam/_index.md",
"funcwithlistparam/_index.md",
"getbastionshareablelink/_index.md",
"getclientconfig/_index.md",
"getintegrationruntimeobjectmetadatum/_index.md",
"liststorageaccountkeys/_index.md",

View file

@ -0,0 +1,296 @@
---
title: "getBastionShareableLink"
title_tag: "mypkg.getBastionShareableLink"
meta_desc: "Documentation for the mypkg.getBastionShareableLink function with examples, input properties, output properties, and supporting types."
layout: api
no_edit_this_page: true
---
<!-- WARNING: this file was generated by test. -->
<!-- Do not edit by hand unless you're certain you know what you are doing! -->
Response for all the Bastion Shareable Link endpoints.
API Version: 2020-11-01.
## Using getBastionShareableLink {#using}
{{< chooser language "typescript,python,go,csharp" / >}}
{{% choosable language nodejs %}}
<div class="highlight"><pre class="chroma"><code class="language-typescript" data-lang="typescript"><span class="k">function </span>getBastionShareableLink<span class="p">(</span><span class="nx">args</span><span class="p">:</span> <span class="nx">GetBastionShareableLinkArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p">?:</span> <span class="nx"><a href="/docs/reference/pkg/nodejs/pulumi/pulumi/#InvokeOptions">InvokeOptions</a></span><span class="p">): Promise&lt;<span class="nx"><a href="#result">GetBastionShareableLinkResult</a></span>></span></code></pre></div>
{{% /choosable %}}
{{% choosable language python %}}
<div class="highlight"><pre class="chroma"><code class="language-python" data-lang="python"><span class="k">def </span>get_bastion_shareable_link(</span><span class="nx">bastion_host_name</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">resource_group_name</span><span class="p">:</span> <span class="nx">Optional[str]</span> = None<span class="p">,</span>
<span class="nx">vms</span><span class="p">:</span> <span class="nx">Optional[Sequence[BastionShareableLink]]</span> = None<span class="p">,</span>
<span class="nx">opts</span><span class="p">:</span> <span class="nx"><a href="/docs/reference/pkg/python/pulumi/#pulumi.InvokeOptions">Optional[InvokeOptions]</a></span> = None<span class="p">) -&gt;</span> GetBastionShareableLinkResult</code></pre></div>
{{% /choosable %}}
{{% choosable language go %}}
<div class="highlight"><pre class="chroma"><code class="language-go" data-lang="go"><span class="k">func </span>GetBastionShareableLink<span class="p">(</span><span class="nx">ctx</span><span class="p"> *</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#Context">Context</a></span><span class="p">,</span> <span class="nx">args</span><span class="p"> *</span><span class="nx">GetBastionShareableLinkArgs</span><span class="p">,</span> <span class="nx">opts</span><span class="p"> ...</span><span class="nx"><a href="https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/pulumi?tab=doc#InvokeOption">InvokeOption</a></span><span class="p">) (*<span class="nx"><a href="#result">GetBastionShareableLinkResult</a></span>, error)</span></code></pre></div>
> Note: This function is named `GetBastionShareableLink` in the Go SDK.
{{% /choosable %}}
{{% choosable language csharp %}}
<div class="highlight"><pre class="chroma"><code class="language-csharp" data-lang="csharp"><span class="k">public static class </span><span class="nx">GetBastionShareableLink </span><span class="p">{</span><span class="k">
public static </span>Task&lt;<span class="nx"><a href="#result">GetBastionShareableLinkResult</a></span>> <span class="p">InvokeAsync(</span><span class="nx">GetBastionShareableLinkArgs</span><span class="p"> </span><span class="nx">args<span class="p">,</span> <span class="nx"><a href="/docs/reference/pkg/dotnet/Pulumi/Pulumi.InvokeOptions.html">InvokeOptions</a></span><span class="p">? </span><span class="nx">opts = null<span class="p">)</span><span class="p">
}</span></code></pre></div>
{{% /choosable %}}
The following arguments are supported:
{{% choosable language csharp %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="bastionhostname_csharp">
<a href="#bastionhostname_csharp" style="color: inherit; text-decoration: inherit;">Bastion<wbr>Host<wbr>Name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The name of the Bastion Host.{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="resourcegroupname_csharp">
<a href="#resourcegroupname_csharp" style="color: inherit; text-decoration: inherit;">Resource<wbr>Group<wbr>Name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The name of the resource group.{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="vms_csharp">
<a href="#vms_csharp" style="color: inherit; text-decoration: inherit;">Vms</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#bastionshareablelink">List&lt;Bastion<wbr>Shareable<wbr>Link&gt;</a></span>
</dt>
<dd>{{% md %}}List of VM references.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language go %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="bastionhostname_go">
<a href="#bastionhostname_go" style="color: inherit; text-decoration: inherit;">Bastion<wbr>Host<wbr>Name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The name of the Bastion Host.{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="resourcegroupname_go">
<a href="#resourcegroupname_go" style="color: inherit; text-decoration: inherit;">Resource<wbr>Group<wbr>Name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The name of the resource group.{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="vms_go">
<a href="#vms_go" style="color: inherit; text-decoration: inherit;">Vms</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#bastionshareablelink">[]Bastion<wbr>Shareable<wbr>Link</a></span>
</dt>
<dd>{{% md %}}List of VM references.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language nodejs %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="bastionhostname_nodejs">
<a href="#bastionhostname_nodejs" style="color: inherit; text-decoration: inherit;">bastion<wbr>Host<wbr>Name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The name of the Bastion Host.{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="resourcegroupname_nodejs">
<a href="#resourcegroupname_nodejs" style="color: inherit; text-decoration: inherit;">resource<wbr>Group<wbr>Name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The name of the resource group.{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="vms_nodejs">
<a href="#vms_nodejs" style="color: inherit; text-decoration: inherit;">vms</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#bastionshareablelink">Bastion<wbr>Shareable<wbr>Link[]</a></span>
</dt>
<dd>{{% md %}}List of VM references.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language python %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="bastion_host_name_python">
<a href="#bastion_host_name_python" style="color: inherit; text-decoration: inherit;">bastion_<wbr>host_<wbr>name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}The name of the Bastion Host.{{% /md %}}</dd><dt class="property-required"
title="Required">
<span id="resource_group_name_python">
<a href="#resource_group_name_python" style="color: inherit; text-decoration: inherit;">resource_<wbr>group_<wbr>name</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}The name of the resource group.{{% /md %}}</dd><dt class="property-optional"
title="Optional">
<span id="vms_python">
<a href="#vms_python" style="color: inherit; text-decoration: inherit;">vms</a>
</span>
<span class="property-indicator"></span>
<span class="property-type"><a href="#bastionshareablelink">Sequence[Bastion<wbr>Shareable<wbr>Link]</a></span>
</dt>
<dd>{{% md %}}List of VM references.{{% /md %}}</dd></dl>
{{% /choosable %}}
## getBastionShareableLink Result {#result}
The following output properties are available:
{{% choosable language csharp %}}
<dl class="resources-properties"><dt class="property-"
title="">
<span id="nextlink_csharp">
<a href="#nextlink_csharp" style="color: inherit; text-decoration: inherit;">Next<wbr>Link</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The URL to get the next set of results.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language go %}}
<dl class="resources-properties"><dt class="property-"
title="">
<span id="nextlink_go">
<a href="#nextlink_go" style="color: inherit; text-decoration: inherit;">Next<wbr>Link</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The URL to get the next set of results.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language nodejs %}}
<dl class="resources-properties"><dt class="property-"
title="">
<span id="nextlink_nodejs">
<a href="#nextlink_nodejs" style="color: inherit; text-decoration: inherit;">next<wbr>Link</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}The URL to get the next set of results.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language python %}}
<dl class="resources-properties"><dt class="property-"
title="">
<span id="next_link_python">
<a href="#next_link_python" style="color: inherit; text-decoration: inherit;">next_<wbr>link</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}The URL to get the next set of results.{{% /md %}}</dd></dl>
{{% /choosable %}}
## Supporting Types
<h4 id="bastionshareablelink">Bastion<wbr>Shareable<wbr>Link</h4>
{{% choosable language csharp %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="vm_csharp">
<a href="#vm_csharp" style="color: inherit; text-decoration: inherit;">Vm</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}Reference of the virtual machine resource.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language go %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="vm_go">
<a href="#vm_go" style="color: inherit; text-decoration: inherit;">Vm</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}Reference of the virtual machine resource.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language nodejs %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="vm_nodejs">
<a href="#vm_nodejs" style="color: inherit; text-decoration: inherit;">vm</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">string</span>
</dt>
<dd>{{% md %}}Reference of the virtual machine resource.{{% /md %}}</dd></dl>
{{% /choosable %}}
{{% choosable language python %}}
<dl class="resources-properties"><dt class="property-required"
title="Required">
<span id="vm_python">
<a href="#vm_python" style="color: inherit; text-decoration: inherit;">vm</a>
</span>
<span class="property-indicator"></span>
<span class="property-type">str</span>
</dt>
<dd>{{% md %}}Reference of the virtual machine resource.{{% /md %}}</dd></dl>
{{% /choosable %}}
<h2 id="package-details">Package Details</h2>
<dl class="package-details">
<dt>Repository</dt>
<dd><a href=""></a></dd>
<dt>License</dt>
<dd></dd>
</dl>

View file

@ -0,0 +1,42 @@
// Copyright 2016-2021, Pulumi Corporation
using System;
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
namespace Pulumi.Mypkg
{
public static class Assert
{
public static OutputAssert<T> Output<T>(Func<Output<T>> builder)
{
return new OutputAssert<T>(builder);
}
}
public class OutputAssert<T>
{
public OutputAssert(Func<Output<T>> builder)
{
this.Builder = builder;
}
public Func<Output<T>> Builder { get; private set; }
public async Task DependsOn(string urn)
{
var mocks = new Mocks();
var actual = await TestHelpers.Run(mocks, this.Builder);
actual.Deps.Should().Contain(x => x.Contains(urn));
}
public async Task ResolvesTo(T expected)
{
var mocks = new Mocks();
var actual = await TestHelpers.Run(mocks, this.Builder);
actual.Result.Should().Be(expected);
}
}
}

View file

@ -0,0 +1,204 @@
// Copyright 2016-2021, Pulumi Corporation
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using FluentAssertions;
using NUnit.Framework;
using Moq;
using Pulumi;
using Pulumi.Testing;
using Pulumi.Mypkg.Outputs;
using static Pulumi.Mypkg.TestHelpers;
namespace Pulumi.Mypkg
{
[TestFixture]
public class UnitTests
{
[Test]
public async Task DependenciesPropagate()
{
await Assert.Output(() =>
{
var dep = new MockDep("res1");
var args = new FuncWithAllOptionalInputsInvokeArgs
{
A = dep.MockDepOutput,
};
return FuncWithAllOptionalInputs.Invoke(args).Apply(x => x.R);
}).DependsOn("mockdep::res1");
}
[Test]
public async Task FuncWithAllOptionalInputsOutputWorks()
{
Func<string,Func<FuncWithAllOptionalInputsInvokeArgs?>,Task> check = (
(expected, args) => Assert
.Output(() => FuncWithAllOptionalInputs.Invoke(args()).Apply(x => x.R))
.ResolvesTo(expected)
);
await check("a=null b=null", () => null);
await check("a=null b=null", () => new FuncWithAllOptionalInputsInvokeArgs());
await check("a=my-a b=null", () => new FuncWithAllOptionalInputsInvokeArgs
{
A = Out("my-a"),
});
await check("a=null b=my-b", () => new FuncWithAllOptionalInputsInvokeArgs
{
B = Out("my-b"),
});
await check("a=my-a b=my-b", () => new FuncWithAllOptionalInputsInvokeArgs
{
A = Out("my-a"),
B = Out("my-b"),
});
}
[Test]
public async Task FuncWithDefaultValueOutputWorks()
{
Func<string,Func<FuncWithDefaultValueInvokeArgs>,Task> check = (
(expected, args) => Assert
.Output(() => FuncWithDefaultValue.Invoke(args()).Apply(x => x.R))
.ResolvesTo(expected)
);
// Since A is required, not passing it is an exception.
Func<Task> act = () => check("", () => new FuncWithDefaultValueInvokeArgs());
await act.Should().ThrowAsync<Exception>();
// Check that default values from the schema work.
await check("a=my-a b=b-default", () => new FuncWithDefaultValueInvokeArgs()
{
A = Out("my-a")
});
await check("a=my-a b=my-b", () => new FuncWithDefaultValueInvokeArgs()
{
A = Out("my-a"),
B = Out("my-b")
});
}
[Test]
public async Task FuncWithDictParamOutputWorks()
{
Func<string,Func<FuncWithDictParamInvokeArgs>,Task> check = (
(expected, args) => Assert
.Output(() => FuncWithDictParam.Invoke(args()).Apply(x => x.R))
.ResolvesTo(expected)
);
var map = new InputMap<string>();
map.Add("K1", Out("my-k1"));
map.Add("K2", Out("my-k2"));
// Omitted value defaults to null.
await check("a=null b=null", () => new FuncWithDictParamInvokeArgs());
await check("a=[K1: my-k1, K2: my-k2] b=null", () => new FuncWithDictParamInvokeArgs()
{
A = map,
});
await check("a=[K1: my-k1, K2: my-k2] b=my-b", () => new FuncWithDictParamInvokeArgs()
{
A = map,
B = Out("my-b"),
});
}
[Test]
public async Task FuncWithListParamOutputWorks()
{
Func<string,Func<FuncWithListParamInvokeArgs>,Task> check = (
(expected, args) => Assert
.Output(() => FuncWithListParam.Invoke(args()).Apply(x => x.R))
.ResolvesTo(expected)
);
var lst = new InputList<string>();
lst.Add("e1");
lst.Add("e2");
lst.Add("e3");
// Similarly to dicts, omitted value defaults to null, not empty list.
await check("a=null b=null", () => new FuncWithListParamInvokeArgs());
await check("a=[e1, e2, e3] b=null", () => new FuncWithListParamInvokeArgs()
{
A = lst,
});
await check("a=[e1, e2, e3] b=my-b", () => new FuncWithListParamInvokeArgs()
{
A = lst,
B = Out("my-b"),
});
}
[Test]
public async Task GetIntegrationRuntimeObjectMetadatumOuputWorks()
{
Func<string,Func<GetIntegrationRuntimeObjectMetadatumInvokeArgs>,Task> check = (
(expected, args) => Assert
.Output(() => GetIntegrationRuntimeObjectMetadatum.Invoke(args()).Apply(x => {
var nextLink = x.NextLink ?? "null";
var valueRepr = "null";
if (x.Value != null)
{
valueRepr = string.Join(", ", x.Value.Select(e => $"{e}"));
}
return $"nextLink={nextLink} value=[{valueRepr}]";
}))
.ResolvesTo(expected)
);
await check("nextLink=my-next-link value=[factoryName: my-fn, integrationRuntimeName: my-irn, " +
"metadataPath: my-mp, resourceGroupName: my-rgn]",
() => new GetIntegrationRuntimeObjectMetadatumInvokeArgs()
{
FactoryName = Out("my-fn"),
IntegrationRuntimeName = Out("my-irn"),
MetadataPath = Out("my-mp"),
ResourceGroupName = Out("my-rgn")
});
}
[Test]
public async Task TestListStorageAccountsOutputWorks()
{
Func<StorageAccountKeyResponse, string> showSAKR = (r) =>
$"CreationTime={r.CreationTime} KeyName={r.KeyName} Permissions={r.Permissions} Value={r.Value}";
Func<string,Func<ListStorageAccountKeysInvokeArgs>,Task> check = (
(expected, args) => Assert
.Output(() => ListStorageAccountKeys.Invoke(args()).Apply(x => {
return "[" + string.Join(", ", x.Keys.Select(k => showSAKR(k))) + "]";
})).ResolvesTo(expected)
);
await check("[CreationTime=my-creation-time KeyName=my-key-name Permissions=my-permissions" +
" Value=[accountName: my-an, expand: my-expand, resourceGroupName: my-rgn]]",
() => new ListStorageAccountKeysInvokeArgs()
{
AccountName = Out("my-an"),
ResourceGroupName = Out("my-rgn"),
Expand = Out("my-expand")
});
}
}
}

View file

@ -0,0 +1,22 @@
// Copyright 2016-2021, Pulumi Corporation
using Pulumi;
namespace Pulumi.Mypkg
{
[ResourceType("mypkg::mockdep", null)]
public sealed class MockDep : CustomResource
{
[Output("mockDepOutput")]
public Output<string> MockDepOutput { get; private set; } = null!;
public MockDep(string name, MockDepArgs? args = null, CustomResourceOptions? options = null)
: base("mypkg::mockdep", name, args ?? new MockDepArgs(), options)
{
}
}
public sealed class MockDepArgs : ResourceArgs
{
}
}

View file

@ -0,0 +1,104 @@
// Copyright 2016-2021, Pulumi Corporation
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using Pulumi.Testing;
namespace Pulumi.Mypkg
{
public class Mocks : IMocks
{
public Task<object> CallAsync(MockCallArgs args)
{
if (args.Token == "mypkg::funcWithAllOptionalInputs"
|| args.Token == "mypkg::funcWithDefaultValue")
{
var dictBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
var a = args.Args.GetValueOrDefault("a", "null");
var b = args.Args.GetValueOrDefault("b", "null");
dictBuilder.Add("r", $"a={a} b={b}");
var result = dictBuilder.ToImmutableDictionary();
return Task.FromResult((Object)result);
}
if (args.Token == "mypkg::funcWithDictParam")
{
string aString = "null";
if (args.Args.ContainsKey("a"))
{
var a = (ImmutableDictionary<string,object>)args.Args["a"];
aString = string.Join(", ", a.Keys.OrderBy(k => k).Select(k => $"{k}: {a[k]}"));
aString = $"[{aString}]";
}
var b = args.Args.GetValueOrDefault("b", "null");
var dictBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
dictBuilder.Add("r", $"a={aString} b={b}");
var result = dictBuilder.ToImmutableDictionary();
return Task.FromResult((Object)result);
}
if (args.Token == "mypkg::funcWithListParam")
{
string aString = "null";
if (args.Args.ContainsKey("a"))
{
var a = (ImmutableArray<object>)args.Args["a"];
aString = string.Join(", ", a.OrderBy(k => k).Select(e => $"{e}"));
aString = $"[{aString}]";
}
var b = args.Args.GetValueOrDefault("b", "null");
var dictBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
dictBuilder.Add("r", $"a={aString} b={b}");
var result = dictBuilder.ToImmutableDictionary();
return Task.FromResult((Object)result);
}
if (args.Token == "mypkg::getIntegrationRuntimeObjectMetadatum")
{
var argsString = string.Join(", ", args.Args.Keys.OrderBy(k => k).Select(k => $"{k}: {args.Args[k]}"));
var dictBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
var arrayBuilder = ImmutableArray.CreateBuilder<object>();
arrayBuilder.Add(argsString);
dictBuilder.Add("value", arrayBuilder.ToImmutableArray());
dictBuilder.Add("nextLink", "my-next-link");
var result = dictBuilder.ToImmutableDictionary();
return Task.FromResult((Object)result);
}
if (args.Token == "mypkg::listStorageAccountKeys")
{
var argsString = string.Join(", ", args.Args.Keys.OrderBy(k => k).Select(k => $"{k}: {args.Args[k]}"));
var dictBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
var arrayBuilder = ImmutableArray.CreateBuilder<object>();
var elemBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
elemBuilder.Add("creationTime", "my-creation-time");
elemBuilder.Add("keyName", "my-key-name");
elemBuilder.Add("permissions", "my-permissions");
elemBuilder.Add("value", "[" + argsString + "]");
arrayBuilder.Add(elemBuilder.ToImmutableDictionary());
dictBuilder.Add("keys", arrayBuilder.ToImmutableArray());
var result = dictBuilder.ToImmutableDictionary();
return Task.FromResult((Object)result);
}
throw new Exception($"CallAsync not implemented for {args.Token}..");
}
public Task<(string? id, object state)> NewResourceAsync(MockResourceArgs args)
{
if (args.Type == "mypkg::mockdep")
{
var dictBuilder = ImmutableDictionary.CreateBuilder<string,Object>();
dictBuilder.Add("mockDepOutput", "mock-dep-output-value");
var result = (object)(dictBuilder.ToImmutableDictionary());
return Task.FromResult<(string? id, object state)>((id: "mockDep#1", state: result));
}
throw new Exception($"NewResourceAsync not implemented for {args.Type}..");
}
}
}

View file

@ -0,0 +1,86 @@
// Copyright 2016-2021, Pulumi Corporation
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Testing;
using static Pulumi.Utilities.OutputUtilities;
namespace Pulumi.Mypkg
{
public static class TestHelpers
{
public static async Task<(T Result, IEnumerable<string> Deps)> Run<T>(
IMocks mocks, Func<Output<T>> outputGenerator, TestOptions? options = null)
{
options = options ?? new TestOptions();
options.ProjectName = HelperStack.RegisterBuilderAsProjectName(outputGenerator);
var resources = await Deployment.TestAsync<HelperStack>(mocks, options);
var stack = resources.Where(x => x is HelperStack).First() as HelperStack;
if (stack != null)
{
var result = await GetValueAsync(stack.Result);
if (result is T)
{
var deps = await GetDependenciesAsync(stack.Result);
var urns = new List<string>();
foreach (var dep in deps)
{
var urn = await GetValueAsync(dep.Urn);
urns.Add(urn);
}
return (Result: (T)result, Deps: urns);
}
else
{
throw new Exception($"The output did not resolve to the correct type: {result}");
}
}
else
{
throw new Exception("Did not find stack");
}
}
public static Output<T> Out<T>(T x)
{
return Output.Create<T>(x);
}
public class HelperStack : Stack
{
private static ConcurrentDictionary<string,Func<Output<object?>>> registry =
new ConcurrentDictionary<string,Func<Output<object?>>>();
[Output]
public Output<object?> Result { get; private set; }
public HelperStack()
{
Console.WriteLine(Deployment.Instance.ProjectName);
Func<Output<object?>>? outputBuilder;
if (!registry.TryGetValue(Deployment.Instance.ProjectName, out outputBuilder))
{
throw new Exception("Incorrect use of HelperStack");
}
this.Result = outputBuilder.Invoke();
}
public static string RegisterBuilderAsProjectName<T>(Func<Output<T>> builder)
{
var projectName = Guid.NewGuid().ToString();
if (!registry.TryAdd(projectName, () => builder().Apply(x => (object?)x)))
{
throw new Exception("Impossible");
}
return projectName;
}
}
}
}

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -16,6 +17,12 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<FuncWithAllOptionalInputsResult> InvokeAsync(FuncWithAllOptionalInputsArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<FuncWithAllOptionalInputsResult>("mypkg::funcWithAllOptionalInputs", args ?? new FuncWithAllOptionalInputsArgs(), options.WithVersion());
/// <summary>
/// Check codegen of functions with all optional inputs.
/// </summary>
public static Output<FuncWithAllOptionalInputsResult> Invoke(FuncWithAllOptionalInputsInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<FuncWithAllOptionalInputsResult>("mypkg::funcWithAllOptionalInputs", args ?? new FuncWithAllOptionalInputsInvokeArgs(), options.WithVersion());
}
@ -38,6 +45,25 @@ namespace Pulumi.Mypkg
}
}
public sealed class FuncWithAllOptionalInputsInvokeArgs : Pulumi.InvokeArgs
{
/// <summary>
/// Property A
/// </summary>
[Input("a")]
public Input<string>? A { get; set; }
/// <summary>
/// Property B
/// </summary>
[Input("b")]
public Input<string>? B { get; set; }
public FuncWithAllOptionalInputsInvokeArgs()
{
}
}
[OutputType]
public sealed class FuncWithAllOptionalInputsResult

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -16,6 +17,12 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<FuncWithDefaultValueResult> InvokeAsync(FuncWithDefaultValueArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<FuncWithDefaultValueResult>("mypkg::funcWithDefaultValue", args ?? new FuncWithDefaultValueArgs(), options.WithVersion());
/// <summary>
/// Check codegen of functions with default values.
/// </summary>
public static Output<FuncWithDefaultValueResult> Invoke(FuncWithDefaultValueInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<FuncWithDefaultValueResult>("mypkg::funcWithDefaultValue", args ?? new FuncWithDefaultValueInvokeArgs(), options.WithVersion());
}
@ -33,6 +40,20 @@ namespace Pulumi.Mypkg
}
}
public sealed class FuncWithDefaultValueInvokeArgs : Pulumi.InvokeArgs
{
[Input("a", required: true)]
public Input<string> A { get; set; } = null!;
[Input("b")]
public Input<string>? B { get; set; }
public FuncWithDefaultValueInvokeArgs()
{
B = "b-default";
}
}
[OutputType]
public sealed class FuncWithDefaultValueResult

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -16,6 +17,12 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<FuncWithDictParamResult> InvokeAsync(FuncWithDictParamArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<FuncWithDictParamResult>("mypkg::funcWithDictParam", args ?? new FuncWithDictParamArgs(), options.WithVersion());
/// <summary>
/// Check codegen of functions with a Dict&lt;str,str&gt; parameter.
/// </summary>
public static Output<FuncWithDictParamResult> Invoke(FuncWithDictParamInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<FuncWithDictParamResult>("mypkg::funcWithDictParam", args ?? new FuncWithDictParamInvokeArgs(), options.WithVersion());
}
@ -37,6 +44,24 @@ namespace Pulumi.Mypkg
}
}
public sealed class FuncWithDictParamInvokeArgs : Pulumi.InvokeArgs
{
[Input("a")]
private InputMap<string>? _a;
public InputMap<string> A
{
get => _a ?? (_a = new InputMap<string>());
set => _a = value;
}
[Input("b")]
public Input<string>? B { get; set; }
public FuncWithDictParamInvokeArgs()
{
}
}
[OutputType]
public sealed class FuncWithDictParamResult

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -16,6 +17,12 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<FuncWithListParamResult> InvokeAsync(FuncWithListParamArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<FuncWithListParamResult>("mypkg::funcWithListParam", args ?? new FuncWithListParamArgs(), options.WithVersion());
/// <summary>
/// Check codegen of functions with a List parameter.
/// </summary>
public static Output<FuncWithListParamResult> Invoke(FuncWithListParamInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<FuncWithListParamResult>("mypkg::funcWithListParam", args ?? new FuncWithListParamInvokeArgs(), options.WithVersion());
}
@ -37,6 +44,24 @@ namespace Pulumi.Mypkg
}
}
public sealed class FuncWithListParamInvokeArgs : Pulumi.InvokeArgs
{
[Input("a")]
private InputList<string>? _a;
public InputList<string> A
{
get => _a ?? (_a = new InputList<string>());
set => _a = value;
}
[Input("b")]
public Input<string>? B { get; set; }
public FuncWithListParamInvokeArgs()
{
}
}
[OutputType]
public sealed class FuncWithListParamResult

View file

@ -0,0 +1,108 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
public static class GetBastionShareableLink
{
/// <summary>
/// Response for all the Bastion Shareable Link endpoints.
/// API Version: 2020-11-01.
/// </summary>
public static Task<GetBastionShareableLinkResult> InvokeAsync(GetBastionShareableLinkArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetBastionShareableLinkResult>("mypkg::getBastionShareableLink", args ?? new GetBastionShareableLinkArgs(), options.WithVersion());
/// <summary>
/// Response for all the Bastion Shareable Link endpoints.
/// API Version: 2020-11-01.
/// </summary>
public static Output<GetBastionShareableLinkResult> Invoke(GetBastionShareableLinkInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<GetBastionShareableLinkResult>("mypkg::getBastionShareableLink", args ?? new GetBastionShareableLinkInvokeArgs(), options.WithVersion());
}
public sealed class GetBastionShareableLinkArgs : Pulumi.InvokeArgs
{
/// <summary>
/// The name of the Bastion Host.
/// </summary>
[Input("bastionHostName", required: true)]
public string BastionHostName { get; set; } = null!;
/// <summary>
/// The name of the resource group.
/// </summary>
[Input("resourceGroupName", required: true)]
public string ResourceGroupName { get; set; } = null!;
[Input("vms")]
private List<Inputs.BastionShareableLink>? _vms;
/// <summary>
/// List of VM references.
/// </summary>
public List<Inputs.BastionShareableLink> Vms
{
get => _vms ?? (_vms = new List<Inputs.BastionShareableLink>());
set => _vms = value;
}
public GetBastionShareableLinkArgs()
{
}
}
public sealed class GetBastionShareableLinkInvokeArgs : Pulumi.InvokeArgs
{
/// <summary>
/// The name of the Bastion Host.
/// </summary>
[Input("bastionHostName", required: true)]
public Input<string> BastionHostName { get; set; } = null!;
/// <summary>
/// The name of the resource group.
/// </summary>
[Input("resourceGroupName", required: true)]
public Input<string> ResourceGroupName { get; set; } = null!;
[Input("vms")]
private InputList<Inputs.BastionShareableLinkArgs>? _vms;
/// <summary>
/// List of VM references.
/// </summary>
public InputList<Inputs.BastionShareableLinkArgs> Vms
{
get => _vms ?? (_vms = new InputList<Inputs.BastionShareableLinkArgs>());
set => _vms = value;
}
public GetBastionShareableLinkInvokeArgs()
{
}
}
[OutputType]
public sealed class GetBastionShareableLinkResult
{
/// <summary>
/// The URL to get the next set of results.
/// </summary>
public readonly string? NextLink;
[OutputConstructor]
private GetBastionShareableLinkResult(string? nextLink)
{
NextLink = nextLink;
}
}
}

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -17,6 +18,13 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<GetIntegrationRuntimeObjectMetadatumResult> InvokeAsync(GetIntegrationRuntimeObjectMetadatumArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetIntegrationRuntimeObjectMetadatumResult>("mypkg::getIntegrationRuntimeObjectMetadatum", args ?? new GetIntegrationRuntimeObjectMetadatumArgs(), options.WithVersion());
/// <summary>
/// Another failing example. A list of SSIS object metadata.
/// API Version: 2018-06-01.
/// </summary>
public static Output<GetIntegrationRuntimeObjectMetadatumResult> Invoke(GetIntegrationRuntimeObjectMetadatumInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<GetIntegrationRuntimeObjectMetadatumResult>("mypkg::getIntegrationRuntimeObjectMetadatum", args ?? new GetIntegrationRuntimeObjectMetadatumInvokeArgs(), options.WithVersion());
}
@ -51,6 +59,37 @@ namespace Pulumi.Mypkg
}
}
public sealed class GetIntegrationRuntimeObjectMetadatumInvokeArgs : Pulumi.InvokeArgs
{
/// <summary>
/// The factory name.
/// </summary>
[Input("factoryName", required: true)]
public Input<string> FactoryName { get; set; } = null!;
/// <summary>
/// The integration runtime name.
/// </summary>
[Input("integrationRuntimeName", required: true)]
public Input<string> IntegrationRuntimeName { get; set; } = null!;
/// <summary>
/// Metadata path.
/// </summary>
[Input("metadataPath")]
public Input<string>? MetadataPath { get; set; }
/// <summary>
/// The resource group name.
/// </summary>
[Input("resourceGroupName", required: true)]
public Input<string> ResourceGroupName { get; set; } = null!;
public GetIntegrationRuntimeObjectMetadatumInvokeArgs()
{
}
}
[OutputType]
public sealed class GetIntegrationRuntimeObjectMetadatumResult

View file

@ -0,0 +1,28 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Mypkg.Inputs
{
/// <summary>
/// Bastion Shareable Link.
/// </summary>
public sealed class BastionShareableLink : Pulumi.InvokeArgs
{
/// <summary>
/// Reference of the virtual machine resource.
/// </summary>
[Input("vm", required: true)]
public string Vm { get; set; } = null!;
public BastionShareableLink()
{
}
}
}

View file

@ -0,0 +1,28 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Mypkg.Inputs
{
/// <summary>
/// Bastion Shareable Link.
/// </summary>
public sealed class BastionShareableLinkArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Reference of the virtual machine resource.
/// </summary>
[Input("vm", required: true)]
public Input<string> Vm { get; set; } = null!;
public BastionShareableLinkArgs()
{
}
}
}

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Mypkg
{
@ -17,6 +18,13 @@ namespace Pulumi.Mypkg
/// </summary>
public static Task<ListStorageAccountKeysResult> InvokeAsync(ListStorageAccountKeysArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ListStorageAccountKeysResult>("mypkg::listStorageAccountKeys", args ?? new ListStorageAccountKeysArgs(), options.WithVersion());
/// <summary>
/// The response from the ListKeys operation.
/// API Version: 2021-02-01.
/// </summary>
public static Output<ListStorageAccountKeysResult> Invoke(ListStorageAccountKeysInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ListStorageAccountKeysResult>("mypkg::listStorageAccountKeys", args ?? new ListStorageAccountKeysInvokeArgs(), options.WithVersion());
}
@ -45,6 +53,31 @@ namespace Pulumi.Mypkg
}
}
public sealed class ListStorageAccountKeysInvokeArgs : Pulumi.InvokeArgs
{
/// <summary>
/// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
/// </summary>
[Input("accountName", required: true)]
public Input<string> AccountName { get; set; } = null!;
/// <summary>
/// Specifies type of the key to be listed. Possible value is kerb.
/// </summary>
[Input("expand")]
public Input<string>? Expand { get; set; }
/// <summary>
/// The name of the resource group within the user's subscription. The name is case insensitive.
/// </summary>
[Input("resourceGroupName", required: true)]
public Input<string> ResourceGroupName { get; set; } = null!;
public ListStorageAccountKeysInvokeArgs()
{
}
}
[OutputType]
public sealed class ListStorageAccountKeysResult

View file

@ -40,7 +40,15 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.13" />
<PackageReference Include="FluentAssertions" Version="5.10.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Moq" Version="4.13.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\..\sdk\dotnet\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>

View file

@ -5,8 +5,11 @@
"FuncWithDefaultValue.cs",
"FuncWithDictParam.cs",
"FuncWithListParam.cs",
"GetBastionShareableLink.cs",
"GetClientConfig.cs",
"GetIntegrationRuntimeObjectMetadatum.cs",
"Inputs/BastionShareableLink.cs",
"Inputs/BastionShareableLinkArgs.cs",
"ListStorageAccountKeys.cs",
"Outputs/SsisEnvironmentReferenceResponse.cs",
"Outputs/SsisEnvironmentResponse.cs",

View file

@ -6,6 +6,7 @@
"mypkg/funcWithDefaultValue.go",
"mypkg/funcWithDictParam.go",
"mypkg/funcWithListParam.go",
"mypkg/getBastionShareableLink.go",
"mypkg/getClientConfig.go",
"mypkg/getIntegrationRuntimeObjectMetadatum.go",
"mypkg/init.go",

View file

@ -0,0 +1,83 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package mypkg
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Response for all the Bastion Shareable Link endpoints.
// API Version: 2020-11-01.
func GetBastionShareableLink(ctx *pulumi.Context, args *GetBastionShareableLinkArgs, opts ...pulumi.InvokeOption) (*GetBastionShareableLinkResult, error) {
var rv GetBastionShareableLinkResult
err := ctx.Invoke("mypkg::getBastionShareableLink", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type GetBastionShareableLinkArgs struct {
// The name of the Bastion Host.
BastionHostName string `pulumi:"bastionHostName"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// List of VM references.
Vms []BastionShareableLink `pulumi:"vms"`
}
// Response for all the Bastion Shareable Link endpoints.
type GetBastionShareableLinkResult struct {
// The URL to get the next set of results.
NextLink *string `pulumi:"nextLink"`
}
func GetBastionShareableLinkOutput(ctx *pulumi.Context, args GetBastionShareableLinkOutputArgs, opts ...pulumi.InvokeOption) GetBastionShareableLinkResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetBastionShareableLinkResult, error) {
args := v.(GetBastionShareableLinkArgs)
r, err := GetBastionShareableLink(ctx, &args, opts...)
return *r, err
}).(GetBastionShareableLinkResultOutput)
}
type GetBastionShareableLinkOutputArgs struct {
// The name of the Bastion Host.
BastionHostName pulumi.StringInput `pulumi:"bastionHostName"`
// The name of the resource group.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// List of VM references.
Vms BastionShareableLinkArrayInput `pulumi:"vms"`
}
func (GetBastionShareableLinkOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetBastionShareableLinkArgs)(nil)).Elem()
}
// Response for all the Bastion Shareable Link endpoints.
type GetBastionShareableLinkResultOutput struct{ *pulumi.OutputState }
func (GetBastionShareableLinkResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetBastionShareableLinkResult)(nil)).Elem()
}
func (o GetBastionShareableLinkResultOutput) ToGetBastionShareableLinkResultOutput() GetBastionShareableLinkResultOutput {
return o
}
func (o GetBastionShareableLinkResultOutput) ToGetBastionShareableLinkResultOutputWithContext(ctx context.Context) GetBastionShareableLinkResultOutput {
return o
}
// The URL to get the next set of results.
func (o GetBastionShareableLinkResultOutput) NextLink() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetBastionShareableLinkResult) *string { return v.NextLink }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetBastionShareableLinkResultOutput{})
}

View file

@ -10,6 +10,106 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Bastion Shareable Link.
type BastionShareableLink struct {
// Reference of the virtual machine resource.
Vm string `pulumi:"vm"`
}
// BastionShareableLinkInput is an input type that accepts BastionShareableLinkArgs and BastionShareableLinkOutput values.
// You can construct a concrete instance of `BastionShareableLinkInput` via:
//
// BastionShareableLinkArgs{...}
type BastionShareableLinkInput interface {
pulumi.Input
ToBastionShareableLinkOutput() BastionShareableLinkOutput
ToBastionShareableLinkOutputWithContext(context.Context) BastionShareableLinkOutput
}
// Bastion Shareable Link.
type BastionShareableLinkArgs struct {
// Reference of the virtual machine resource.
Vm pulumi.StringInput `pulumi:"vm"`
}
func (BastionShareableLinkArgs) ElementType() reflect.Type {
return reflect.TypeOf((*BastionShareableLink)(nil)).Elem()
}
func (i BastionShareableLinkArgs) ToBastionShareableLinkOutput() BastionShareableLinkOutput {
return i.ToBastionShareableLinkOutputWithContext(context.Background())
}
func (i BastionShareableLinkArgs) ToBastionShareableLinkOutputWithContext(ctx context.Context) BastionShareableLinkOutput {
return pulumi.ToOutputWithContext(ctx, i).(BastionShareableLinkOutput)
}
// BastionShareableLinkArrayInput is an input type that accepts BastionShareableLinkArray and BastionShareableLinkArrayOutput values.
// You can construct a concrete instance of `BastionShareableLinkArrayInput` via:
//
// BastionShareableLinkArray{ BastionShareableLinkArgs{...} }
type BastionShareableLinkArrayInput interface {
pulumi.Input
ToBastionShareableLinkArrayOutput() BastionShareableLinkArrayOutput
ToBastionShareableLinkArrayOutputWithContext(context.Context) BastionShareableLinkArrayOutput
}
type BastionShareableLinkArray []BastionShareableLinkInput
func (BastionShareableLinkArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]BastionShareableLink)(nil)).Elem()
}
func (i BastionShareableLinkArray) ToBastionShareableLinkArrayOutput() BastionShareableLinkArrayOutput {
return i.ToBastionShareableLinkArrayOutputWithContext(context.Background())
}
func (i BastionShareableLinkArray) ToBastionShareableLinkArrayOutputWithContext(ctx context.Context) BastionShareableLinkArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BastionShareableLinkArrayOutput)
}
// Bastion Shareable Link.
type BastionShareableLinkOutput struct{ *pulumi.OutputState }
func (BastionShareableLinkOutput) ElementType() reflect.Type {
return reflect.TypeOf((*BastionShareableLink)(nil)).Elem()
}
func (o BastionShareableLinkOutput) ToBastionShareableLinkOutput() BastionShareableLinkOutput {
return o
}
func (o BastionShareableLinkOutput) ToBastionShareableLinkOutputWithContext(ctx context.Context) BastionShareableLinkOutput {
return o
}
// Reference of the virtual machine resource.
func (o BastionShareableLinkOutput) Vm() pulumi.StringOutput {
return o.ApplyT(func(v BastionShareableLink) string { return v.Vm }).(pulumi.StringOutput)
}
type BastionShareableLinkArrayOutput struct{ *pulumi.OutputState }
func (BastionShareableLinkArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]BastionShareableLink)(nil)).Elem()
}
func (o BastionShareableLinkArrayOutput) ToBastionShareableLinkArrayOutput() BastionShareableLinkArrayOutput {
return o
}
func (o BastionShareableLinkArrayOutput) ToBastionShareableLinkArrayOutputWithContext(ctx context.Context) BastionShareableLinkArrayOutput {
return o
}
func (o BastionShareableLinkArrayOutput) Index(i pulumi.IntInput) BastionShareableLinkOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) BastionShareableLink {
return vs[0].([]BastionShareableLink)[vs[1].(int)]
}).(BastionShareableLinkOutput)
}
// Ssis environment reference.
type SsisEnvironmentReferenceResponse struct {
// Environment folder name.
@ -1048,6 +1148,8 @@ func (o StorageAccountKeyResponseArrayOutput) Index(i pulumi.IntInput) StorageAc
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BastionShareableLinkInput)(nil)).Elem(), BastionShareableLinkArgs{})
pulumi.RegisterInputType(reflect.TypeOf((*BastionShareableLinkArrayInput)(nil)).Elem(), BastionShareableLinkArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SsisEnvironmentReferenceResponseInput)(nil)).Elem(), SsisEnvironmentReferenceResponseArgs{})
pulumi.RegisterInputType(reflect.TypeOf((*SsisEnvironmentReferenceResponseArrayInput)(nil)).Elem(), SsisEnvironmentReferenceResponseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SsisEnvironmentResponseInput)(nil)).Elem(), SsisEnvironmentResponseArgs{})
@ -1060,6 +1162,8 @@ func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SsisVariableResponseArrayInput)(nil)).Elem(), SsisVariableResponseArray{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageAccountKeyResponseInput)(nil)).Elem(), StorageAccountKeyResponseArgs{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageAccountKeyResponseArrayInput)(nil)).Elem(), StorageAccountKeyResponseArray{})
pulumi.RegisterOutputType(BastionShareableLinkOutput{})
pulumi.RegisterOutputType(BastionShareableLinkArrayOutput{})
pulumi.RegisterOutputType(SsisEnvironmentReferenceResponseOutput{})
pulumi.RegisterOutputType(SsisEnvironmentReferenceResponseArrayOutput{})
pulumi.RegisterOutputType(SsisEnvironmentResponseOutput{})

View file

@ -6,6 +6,7 @@
"funcWithDefaultValue.ts",
"funcWithDictParam.ts",
"funcWithListParam.ts",
"getBastionShareableLink.ts",
"getClientConfig.ts",
"getIntegrationRuntimeObjectMetadatum.ts",
"index.ts",

View file

@ -0,0 +1,69 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "./types";
import * as utilities from "./utilities";
/**
* Response for all the Bastion Shareable Link endpoints.
* API Version: 2020-11-01.
*/
export function getBastionShareableLink(args: GetBastionShareableLinkArgs, opts?: pulumi.InvokeOptions): Promise<GetBastionShareableLinkResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("mypkg::getBastionShareableLink", {
"bastionHostName": args.bastionHostName,
"resourceGroupName": args.resourceGroupName,
"vms": args.vms,
}, opts);
}
export interface GetBastionShareableLinkArgs {
/**
* The name of the Bastion Host.
*/
bastionHostName: string;
/**
* The name of the resource group.
*/
resourceGroupName: string;
/**
* List of VM references.
*/
vms?: inputs.BastionShareableLink[];
}
/**
* Response for all the Bastion Shareable Link endpoints.
*/
export interface GetBastionShareableLinkResult {
/**
* The URL to get the next set of results.
*/
readonly nextLink?: string;
}
export function getBastionShareableLinkOutput(args: GetBastionShareableLinkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetBastionShareableLinkResult> {
return pulumi.output(args).apply(a => getBastionShareableLink(a, opts))
}
export interface GetBastionShareableLinkOutputArgs {
/**
* The name of the Bastion Host.
*/
bastionHostName: pulumi.Input<string>;
/**
* The name of the resource group.
*/
resourceGroupName: pulumi.Input<string>;
/**
* List of VM references.
*/
vms?: pulumi.Input<pulumi.Input<inputs.BastionShareableLinkArgs>[]>;
}

View file

@ -10,6 +10,7 @@ export * from "./funcWithConstInput";
export * from "./funcWithDefaultValue";
export * from "./funcWithDictParam";
export * from "./funcWithListParam";
export * from "./getBastionShareableLink";
export * from "./getClientConfig";
export * from "./getIntegrationRuntimeObjectMetadatum";
export * from "./listStorageAccountKeys";

View file

@ -18,6 +18,7 @@
"funcWithDefaultValue.ts",
"funcWithDictParam.ts",
"funcWithListParam.ts",
"getBastionShareableLink.ts",
"getClientConfig.ts",
"getIntegrationRuntimeObjectMetadatum.ts",
"index.ts",

View file

@ -4,3 +4,23 @@
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Bastion Shareable Link.
*/
export interface BastionShareableLink {
/**
* Reference of the virtual machine resource.
*/
vm: string;
}
/**
* Bastion Shareable Link.
*/
export interface BastionShareableLinkArgs {
/**
* Reference of the virtual machine resource.
*/
vm: pulumi.Input<string>;
}

View file

@ -2,12 +2,14 @@
"emittedFiles": [
"pulumi_mypkg/README.md",
"pulumi_mypkg/__init__.py",
"pulumi_mypkg/_inputs.py",
"pulumi_mypkg/_utilities.py",
"pulumi_mypkg/func_with_all_optional_inputs.py",
"pulumi_mypkg/func_with_const_input.py",
"pulumi_mypkg/func_with_default_value.py",
"pulumi_mypkg/func_with_dict_param.py",
"pulumi_mypkg/func_with_list_param.py",
"pulumi_mypkg/get_bastion_shareable_link.py",
"pulumi_mypkg/get_client_config.py",
"pulumi_mypkg/get_integration_runtime_object_metadatum.py",
"pulumi_mypkg/list_storage_account_keys.py",

View file

@ -10,10 +10,12 @@ from .func_with_const_input import *
from .func_with_default_value import *
from .func_with_dict_param import *
from .func_with_list_param import *
from .get_bastion_shareable_link import *
from .get_client_config import *
from .get_integration_runtime_object_metadatum import *
from .list_storage_account_keys import *
from .provider import *
from ._inputs import *
from . import outputs
_utilities.register(
resource_modules="""

View file

@ -0,0 +1,37 @@
# coding=utf-8
# *** WARNING: this file was generated by test. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
__all__ = [
'BastionShareableLink',
]
@pulumi.input_type
class BastionShareableLink:
def __init__(__self__, *,
vm: str):
"""
Bastion Shareable Link.
:param str vm: Reference of the virtual machine resource.
"""
pulumi.set(__self__, "vm", vm)
@property
@pulumi.getter
def vm(self) -> str:
"""
Reference of the virtual machine resource.
"""
return pulumi.get(self, "vm")
@vm.setter
def vm(self, value: str):
pulumi.set(self, "vm", value)

View file

@ -0,0 +1,88 @@
# coding=utf-8
# *** WARNING: this file was generated by test. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from ._inputs import *
__all__ = [
'GetBastionShareableLinkResult',
'AwaitableGetBastionShareableLinkResult',
'get_bastion_shareable_link',
'get_bastion_shareable_link_output',
]
@pulumi.output_type
class GetBastionShareableLinkResult:
"""
Response for all the Bastion Shareable Link endpoints.
"""
def __init__(__self__, next_link=None):
if next_link and not isinstance(next_link, str):
raise TypeError("Expected argument 'next_link' to be a str")
pulumi.set(__self__, "next_link", next_link)
@property
@pulumi.getter(name="nextLink")
def next_link(self) -> Optional[str]:
"""
The URL to get the next set of results.
"""
return pulumi.get(self, "next_link")
class AwaitableGetBastionShareableLinkResult(GetBastionShareableLinkResult):
# pylint: disable=using-constant-test
def __await__(self):
if False:
yield self
return GetBastionShareableLinkResult(
next_link=self.next_link)
def get_bastion_shareable_link(bastion_host_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
vms: Optional[Sequence[pulumi.InputType['BastionShareableLink']]] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBastionShareableLinkResult:
"""
Response for all the Bastion Shareable Link endpoints.
API Version: 2020-11-01.
:param str bastion_host_name: The name of the Bastion Host.
:param str resource_group_name: The name of the resource group.
:param Sequence[pulumi.InputType['BastionShareableLink']] vms: List of VM references.
"""
__args__ = dict()
__args__['bastionHostName'] = bastion_host_name
__args__['resourceGroupName'] = resource_group_name
__args__['vms'] = vms
if opts is None:
opts = pulumi.InvokeOptions()
if opts.version is None:
opts.version = _utilities.get_version()
__ret__ = pulumi.runtime.invoke('mypkg::getBastionShareableLink', __args__, opts=opts, typ=GetBastionShareableLinkResult).value
return AwaitableGetBastionShareableLinkResult(
next_link=__ret__.next_link)
@_utilities.lift_output_func(get_bastion_shareable_link)
def get_bastion_shareable_link_output(bastion_host_name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
vms: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['BastionShareableLink']]]]] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetBastionShareableLinkResult]:
"""
Response for all the Bastion Shareable Link endpoints.
API Version: 2020-11-01.
:param str bastion_host_name: The name of the Bastion Host.
:param str resource_group_name: The name of the resource group.
:param Sequence[pulumi.InputType['BastionShareableLink']] vms: List of VM references.
"""
...

View file

@ -269,9 +269,60 @@
"keys"
]
}
},
"mypkg::getBastionShareableLink": {
"description": "Response for all the Bastion Shareable Link endpoints.\nAPI Version: 2020-11-01.",
"inputs": {
"properties": {
"bastionHostName": {
"type": "string",
"description": "The name of the Bastion Host."
},
"resourceGroupName": {
"type": "string",
"description": "The name of the resource group."
},
"vms": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/types/mypkg::BastionShareableLink"
},
"description": "List of VM references."
}
},
"type": "object",
"required": [
"bastionHostName",
"resourceGroupName"
]
},
"outputs": {
"description": "Response for all the Bastion Shareable Link endpoints.",
"properties": {
"nextLink": {
"type": "string",
"description": "The URL to get the next set of results."
}
},
"type": "object"
}
}
},
"types": {
"mypkg::BastionShareableLink": {
"description": "Bastion Shareable Link.",
"properties": {
"vm": {
"type": "string",
"description": "Reference of the virtual machine resource."
}
},
"type": "object",
"required": [
"vm"
]
},
"mypkg::SsisEnvironmentResponse": {
"description": "Ssis environment.",
"properties": {
@ -583,11 +634,17 @@
"tests/codegen.spec.ts"
]
},
"python": {
},
"python": {},
"csharp": {
"projectReferences": [
"..\\..\\..\\..\\..\\..\\..\\sdk\\dotnet\\Pulumi\\Pulumi.csproj"
],
"packageReferences": {
"Pulumi": "3.13"
"FluentAssertions": "5.10.2",
"Microsoft.NET.Test.Sdk": "16.5.0",
"Moq": "4.13.1",
"NUnit": "3.12.0",
"NUnit3TestAdapter": "3.16.1"
}
}
}

View file

@ -44,6 +44,9 @@
<PackageReference Include="Pulumi.Aws" Version="4.*" ExcludeAssets="contentFiles" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12.0" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12.0" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -0,0 +1,25 @@
// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Example.Nested.Inputs
{
public sealed class BazArgs : Pulumi.ResourceArgs
{
[Input("hello")]
public Input<string>? Hello { get; set; }
[Input("world")]
public Input<string>? World { get; set; }
public BazArgs()
{
}
}
}

View file

@ -41,6 +41,10 @@
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.12" />
<PackageReference Include="Pulumi.Random" Version="4.2.0" ExcludeAssets="contentFiles" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>

View file

@ -2,6 +2,7 @@
"emittedFiles": [
"Foo.cs",
"Nested/Inputs/Baz.cs",
"Nested/Inputs/BazArgs.cs",
"Nested/README.md",
"Provider.cs",
"Pulumi.Example.csproj",

View file

@ -127,7 +127,8 @@
"language": {
"csharp": {
"packageReferences": {
"Pulumi": "3.12"
"Pulumi": "3.12",
"Pulumi.Random": "4.2.0"
}
},
"go": {

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -43,6 +43,9 @@
<PackageReference Include="Pulumi" Version="3.12" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<None Include="logo.png">
<Pack>True</Pack>

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Example
{
@ -13,6 +14,9 @@ namespace Pulumi.Example
{
public static Task<ArgFunctionResult> InvokeAsync(ArgFunctionArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionArgs(), options.WithVersion());
public static Output<ArgFunctionResult> Invoke(ArgFunctionInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionInvokeArgs(), options.WithVersion());
}
@ -26,6 +30,16 @@ namespace Pulumi.Example
}
}
public sealed class ArgFunctionInvokeArgs : Pulumi.InvokeArgs
{
[Input("arg1")]
public Input<Pulumi.Example.Resource>? Arg1 { get; set; }
public ArgFunctionInvokeArgs()
{
}
}
[OutputType]
public sealed class ArgFunctionResult

View file

@ -40,7 +40,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.12" />
<PackageReference Include="Pulumi" Version="3.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\..\sdk\dotnet\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>

View file

@ -117,8 +117,11 @@
"language": {
"csharp": {
"packageReferences": {
"Pulumi": "3.12"
}
"Pulumi": "3.13"
},
"projectReferences": [
"..\\..\\..\\..\\..\\..\\..\\sdk\\dotnet\\Pulumi\\Pulumi.csproj"
]
},
"go": {
"importBasePath": "github.com/pulumi/pulumi/pkg/v3/codegen/internal/test/testdata/simple-resource-schema/go/example"

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Example
{
@ -13,6 +14,9 @@ namespace Pulumi.Example
{
public static Task<ArgFunctionResult> InvokeAsync(ArgFunctionArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionArgs(), options.WithVersion());
public static Output<ArgFunctionResult> Invoke(ArgFunctionInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionInvokeArgs(), options.WithVersion());
}
@ -26,6 +30,16 @@ namespace Pulumi.Example
}
}
public sealed class ArgFunctionInvokeArgs : Pulumi.InvokeArgs
{
[Input("arg1")]
public Input<Pulumi.Example.Resource>? Arg1 { get; set; }
public ArgFunctionInvokeArgs()
{
}
}
[OutputType]
public sealed class ArgFunctionResult

View file

@ -40,7 +40,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.12" />
<PackageReference Include="Pulumi" Version="3.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\..\sdk\dotnet\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>

View file

@ -160,8 +160,11 @@
},
"language": {
"csharp": {
"projectReferences": [
"..\\..\\..\\..\\..\\..\\..\\sdk\\dotnet\\Pulumi\\Pulumi.csproj"
],
"packageReferences": {
"Pulumi": "3.12"
"Pulumi": "3.13"
}
},
"go": {

View file

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Example
{
@ -13,6 +14,9 @@ namespace Pulumi.Example
{
public static Task<ArgFunctionResult> InvokeAsync(ArgFunctionArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionArgs(), options.WithVersion());
public static Output<ArgFunctionResult> Invoke(ArgFunctionInvokeArgs? args = null, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<ArgFunctionResult>("example::argFunction", args ?? new ArgFunctionInvokeArgs(), options.WithVersion());
}
@ -26,6 +30,16 @@ namespace Pulumi.Example
}
}
public sealed class ArgFunctionInvokeArgs : Pulumi.InvokeArgs
{
[Input("arg1")]
public Input<Pulumi.Example.Resource>? Arg1 { get; set; }
public ArgFunctionInvokeArgs()
{
}
}
[OutputType]
public sealed class ArgFunctionResult

View file

@ -40,7 +40,11 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.12" />
<PackageReference Include="Pulumi" Version="3.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\..\..\sdk\dotnet\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>

View file

@ -118,7 +118,7 @@ functions:
result:
"$ref": "#/resources/example::Resource"
language:
csharp: { "packageReferences": { "Pulumi": "3.12" } }
csharp: { "packageReferences": { "Pulumi": "3.13" }, "projectReferences": ["..\\..\\..\\..\\..\\..\\..\\sdk\\dotnet\\Pulumi\\Pulumi.csproj"] }
go:
{
"importBasePath": "github.com/pulumi/pulumi/pkg/v3/codegen/internal/test/testdata/simple-resource-schema/go/example",