pspulumiyaml.azurenative.devops.psm1

using module pspulumiyaml
function Invoke-AzureNativeFunctionDevopsGetPipeline
{
    param (
        [parameter(mandatory=$False,HelpMessage='Name of the resource group within the Azure subscription.)')]
        [string]
        $resourceGroupName,
        [parameter(mandatory=$False,HelpMessage='The name of the Pipeline resource in ARM.)')]
        [string]
        $pipelineName
    )

    process
    {
        $arguments = @{}
        $arguments["pipelineName"] = $pipelineName
        $arguments["resourceGroupName"] = $resourceGroupName

        $functionObject = Invoke-PulumiFunction -Name azure-native:devops:getPipeline -variableName $([guid]::NewGuid().Guid) -Arguments $arguments
        return $functionObject
    }
}
class PipelineTemplate
{
    [object] $parameters
    [string] $id
}
function New-AzureNativeTypeDevopsPipelineTemplate
{
    param (
        [parameter(mandatory=$False,HelpMessage='Dictionary of input parameters used in the pipeline template.)')]
        [hashtable]
        $parameters,
        [parameter(mandatory=$False,HelpMessage='Unique identifier of the pipeline template.)')]
        [string]
        $id
    )

    process
    {
        return $([PipelineTemplate]$PSBoundParameters)
    }
}
class Authorization
{
    [ArgumentCompletions('personalAccessToken')]
    [string] $authorizationType
    [object] $parameters
}
function New-AzureNativeTypeDevopsAuthorization
{
    param (
        [parameter(mandatory=$False,HelpMessage='Type of authorization.)')]
        [string]
        [ValidateSet('personalAccessToken')]
        $authorizationType,
        [parameter(mandatory=$False,HelpMessage='Authorization parameters corresponding to the authorization type.)')]
        [hashtable]
        $parameters
    )

    process
    {
        return $([Authorization]$PSBoundParameters)
    }
}
class CodeRepository
{
    [string] $id
    [object] $properties
    [ArgumentCompletions('gitHub', 'vstsGit')]
    [string] $repositoryType
    [Authorization] $authorization
    [string] $defaultBranch
}
function New-AzureNativeTypeDevopsCodeRepository
{
    param (
        [parameter(mandatory=$False,HelpMessage='Unique immutable identifier of the code repository.)')]
        [string]
        $id,
        [parameter(mandatory=$False,HelpMessage='Repository-specific properties.)')]
        [hashtable]
        $properties,
        [parameter(mandatory=$False,HelpMessage='Type of code repository.)')]
        [string]
        [ValidateSet('gitHub', 'vstsGit')]
        $repositoryType,
        [parameter(mandatory=$False,HelpMessage='Authorization info to access the code repository.)')]
        [Authorization]
        $authorization,
        [parameter(mandatory=$False,HelpMessage='Default branch used to configure Continuous Integration (CI) in the pipeline.)')]
        [string]
        $defaultBranch
    )

    process
    {
        return $([CodeRepository]$PSBoundParameters)
    }
}
class BootstrapConfiguration
{
    [PipelineTemplate] $template
    [CodeRepository] $sourceRepository
}
function New-AzureNativeTypeDevopsBootstrapConfiguration
{
    param (
        [parameter(mandatory=$False,HelpMessage='Template used to bootstrap the pipeline.)')]
        [PipelineTemplate]
        $template,
        [parameter(mandatory=$False,HelpMessage='Repository containing the source code for the pipeline. Currently only ''azurePipeline'' pipeline type supports this.)')]
        [CodeRepository]
        $sourceRepository
    )

    process
    {
        return $([BootstrapConfiguration]$PSBoundParameters)
    }
}
function New-AzureNativeDevopsPipeline
{
    [Alias('azure_native_devops_pipeline')]
    param (
        [parameter(mandatory=$False,HelpMessage='Resource Tags)')]
        [hashtable]
        $tags,
        [parameter(mandatory=$False,HelpMessage='The name of the Pipeline resource in ARM.)')]
        [string]
        $pipelineName,
        [parameter(mandatory=$False,HelpMessage='Specifies which CI/CD provider to use. Valid options are ''azurePipeline'', ''githubWorkflow''.)')]
        [string]
        [ValidateSet('githubWorkflow', 'azurePipeline')]
        $pipelineType,
        [parameter(mandatory=$False,HelpMessage='Name of the resource group within the Azure subscription.)')]
        [string]
        $resourceGroupName,
        [parameter(mandatory=$False,HelpMessage='Resource Location)')]
        [string]
        $location,
        [parameter(mandatory=$False,HelpMessage='Configuration used to bootstrap the Pipeline.)')]
        [BootstrapConfiguration]
        $bootstrapConfiguration,
        [parameter(mandatory,HelpMessage='The reference to call when you want to make a dependency to another resource')]
        [string]
        $pulumiid,
        [parameter(mandatory,HelpMessage='Pass in the resources you make to make this resource dependant on')]
        [object]
        $DependsOn
    )

    process
    {
        $resource = [pulumiresource]::new($pulumiid, "azure-native:devops:Pipeline")

        foreach($Dependency in $DependsOn)
        {
            if($Dependency -is [pulumiresource])
            {
                $resource.dependson += $Dependency.Reference()
            } else
            {
                $resource.dependson += $Dependency
            }
        }
        $resource.properties["bootstrapConfiguration"] = $bootstrapConfiguration
        $resource.properties["pipelineType"] = $pipelineType
        $resource.properties["resourceGroupName"] = $resourceGroupName

        if($PSBoundParameters.Keys -icontains 'tags')
        {
            $resource.properties["tags"] = $tags
        }

        if($PSBoundParameters.Keys -icontains 'pipelineName')
        {
            $resource.properties["pipelineName"] = $pipelineName
        }

        if($PSBoundParameters.Keys -icontains 'location')
        {
            $resource.properties["location"] = $location
        }

        $global:pulumiresources += $resource
        return $resource
    }
}