/*******************************************************************************
* Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* *****************************************************************************
*
* AWS Tools for Windows (TM) PowerShell (TM)
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Amazon.PowerShell.Common;
using Amazon.Runtime;
using Amazon.CodeBuild;
using Amazon.CodeBuild.Model;
namespace Amazon.PowerShell.Cmdlets.CB
{
///
/// Creates a build project.
///
[Cmdlet("New", "CBProject", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
[OutputType("Amazon.CodeBuild.Model.Project")]
[AWSCmdlet("Calls the AWS CodeBuild CreateProject API operation.", Operation = new[] {"CreateProject"}, SelectReturnType = typeof(Amazon.CodeBuild.Model.CreateProjectResponse))]
[AWSCmdletOutput("Amazon.CodeBuild.Model.Project or Amazon.CodeBuild.Model.CreateProjectResponse",
"This cmdlet returns an Amazon.CodeBuild.Model.Project object.",
"The service call response (type Amazon.CodeBuild.Model.CreateProjectResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class NewCBProjectCmdlet : AmazonCodeBuildClientCmdlet, IExecutor
{
#region Parameter Artifacts_ArtifactIdentifier
///
///
/// An identifier for this artifact definition.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Artifacts_ArtifactIdentifier { get; set; }
#endregion
#region Parameter BadgeEnabled
///
///
/// Set this to true to generate a publicly accessible URL for your project's build badge.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? BadgeEnabled { get; set; }
#endregion
#region Parameter BuildBatchConfig_BatchReportMode
///
///
/// Specifies how build status reports are sent to the source provider for the batch build.
/// This property is only used when the source provider for your project is Bitbucket,
/// GitHub, or GitHub Enterprise, and your project is configured to report build statuses
/// to the source provider.- REPORT_AGGREGATED_BATCH
- (Default) Aggregate all of the build statuses into a single status report.
- REPORT_INDIVIDUAL_BUILDS
- Send a separate status report for each individual build.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeBuild.BatchReportModeType")]
public Amazon.CodeBuild.BatchReportModeType BuildBatchConfig_BatchReportMode { get; set; }
#endregion
#region Parameter Artifacts_BucketOwnerAccess
///
///
/// The service has not provided documentation for this parameter; please refer to the service's API reference documentation for the latest available information.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeBuild.BucketOwnerAccess")]
public Amazon.CodeBuild.BucketOwnerAccess Artifacts_BucketOwnerAccess { get; set; }
#endregion
#region Parameter S3Logs_BucketOwnerAccess
///
///
/// The service has not provided documentation for this parameter; please refer to the service's API reference documentation for the latest available information.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_S3Logs_BucketOwnerAccess")]
[AWSConstantClassSource("Amazon.CodeBuild.BucketOwnerAccess")]
public Amazon.CodeBuild.BucketOwnerAccess S3Logs_BucketOwnerAccess { get; set; }
#endregion
#region Parameter Source_Buildspec
///
///
/// The buildspec file declaration to use for the builds in this build project. If this value is set, it can be either an inline buildspec definition, the path to
/// an alternate buildspec file relative to the value of the built-in CODEBUILD_SRC_DIR
/// environment variable, or the path to an S3 bucket. The bucket must be in the same
/// Amazon Web Services Region as the build project. Specify the buildspec file using
/// its ARN (for example, arn:aws:s3:::my-codebuild-sample2/buildspec.yml
).
/// If this value is not provided or is set to an empty string, the source code must contain
/// a buildspec file in its root directory. For more information, see Buildspec
/// File Name and Storage Location.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Source_Buildspec { get; set; }
#endregion
#region Parameter Environment_Certificate
///
///
/// The ARN of the Amazon S3 bucket, path prefix, and object key that contains the PEM-encoded
/// certificate for the build project. For more information, see certificate
/// in the CodeBuild User Guide.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Environment_Certificate { get; set; }
#endregion
#region Parameter BuildBatchConfig_CombineArtifact
///
///
/// Specifies if the build artifacts for the batch build should be combined into a single
/// artifact location.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("BuildBatchConfig_CombineArtifacts")]
public System.Boolean? BuildBatchConfig_CombineArtifact { get; set; }
#endregion
#region Parameter Environment_ComputeType
///
///
/// Information about the compute resources the build project uses. Available values include:BUILD_GENERAL1_SMALL
: Use up to 3 GB memory and 2 vCPUs for builds.BUILD_GENERAL1_MEDIUM
: Use up to 7 GB memory and 4 vCPUs for builds.BUILD_GENERAL1_LARGE
: Use up to 16 GB memory and 8 vCPUs for builds,
/// depending on your environment type.BUILD_GENERAL1_2XLARGE
: Use up to 145 GB memory, 72 vCPUs, and 824 GB
/// of SSD storage for builds. This compute type supports Docker images up to 100 GB uncompressed.
If you use BUILD_GENERAL1_LARGE
: - For environment type
LINUX_CONTAINER
, you can use up to 15 GB memory
/// and 8 vCPUs for builds. - For environment type
LINUX_GPU_CONTAINER
, you can use up to 255 GB memory,
/// 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. - For environment type
ARM_CONTAINER
, you can use up to 16 GB memory and
/// 8 vCPUs on ARM-based processors for builds.
For more information, see Build
/// Environment Compute Types in the CodeBuild User Guide.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
[AWSConstantClassSource("Amazon.CodeBuild.ComputeType")]
public Amazon.CodeBuild.ComputeType Environment_ComputeType { get; set; }
#endregion
#region Parameter Restrictions_ComputeTypesAllowed
///
///
/// An array of strings that specify the compute types that are allowed for the batch
/// build. See Build
/// environment compute types in the CodeBuild User Guide for these values.
///
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("BuildBatchConfig_Restrictions_ComputeTypesAllowed")]
public System.String[] Restrictions_ComputeTypesAllowed { get; set; }
#endregion
#region Parameter ConcurrentBuildLimit
///
///
/// The maximum number of concurrent builds that are allowed for this project.New builds are only started if the current number of builds is less than or equal
/// to this limit. If the current build count meets this limit, new builds are throttled
/// and are not run.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? ConcurrentBuildLimit { get; set; }
#endregion
#region Parameter BuildStatusConfig_Context
///
///
/// Specifies the context of the build status CodeBuild sends to the source provider.
/// The usage of this parameter depends on the source provider.- Bitbucket
- This parameter is used for the
name
parameter in the Bitbucket commit
/// status. For more information, see build
/// in the Bitbucket API documentation. - GitHub/GitHub Enterprise Server
- This parameter is used for the
context
parameter in the GitHub commit
/// status. For more information, see Create
/// a commit status in the GitHub developer guide.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Source_BuildStatusConfig_Context")]
public System.String BuildStatusConfig_Context { get; set; }
#endregion
#region Parameter RegistryCredential_Credential
///
///
/// The Amazon Resource Name (ARN) or name of credentials created using Secrets Manager.
/// The credential
can use the name of the credentials only if they exist
/// in your current Amazon Web Services Region.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Environment_RegistryCredential_Credential")]
public System.String RegistryCredential_Credential { get; set; }
#endregion
#region Parameter RegistryCredential_CredentialProvider
///
///
/// The service that created the credentials to access a private Docker registry. The
/// valid value, SECRETS_MANAGER, is for Secrets Manager.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Environment_RegistryCredential_CredentialProvider")]
[AWSConstantClassSource("Amazon.CodeBuild.CredentialProviderType")]
public Amazon.CodeBuild.CredentialProviderType RegistryCredential_CredentialProvider { get; set; }
#endregion
#region Parameter Description
///
///
/// A description that makes the build project easy to identify.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Description { get; set; }
#endregion
#region Parameter Artifacts_EncryptionDisabled
///
///
/// Set to true if you do not want your output artifacts encrypted. This option is valid
/// only if your artifacts type is Amazon S3. If this is set with another artifacts type,
/// an invalidInputException is thrown.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? Artifacts_EncryptionDisabled { get; set; }
#endregion
#region Parameter S3Logs_EncryptionDisabled
///
///
/// Set to true if you do not want your S3 build log output encrypted. By default S3
/// build logs are encrypted.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_S3Logs_EncryptionDisabled")]
public System.Boolean? S3Logs_EncryptionDisabled { get; set; }
#endregion
#region Parameter EncryptionKey
///
///
/// The Key Management Service customer master key (CMK) to be used for encrypting the
/// build output artifacts.You can use a cross-account KMS key to encrypt the build output artifacts if your
/// service role has permission to that key. You can specify either the Amazon Resource Name (ARN) of the CMK or, if available,
/// the CMK's alias (using the format alias/<alias-name>
).
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String EncryptionKey { get; set; }
#endregion
#region Parameter Environment_EnvironmentVariable
///
///
/// A set of environment variables to make available to builds for this build project.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Environment_EnvironmentVariables")]
public Amazon.CodeBuild.Model.EnvironmentVariable[] Environment_EnvironmentVariable { get; set; }
#endregion
#region Parameter GitSubmodulesConfig_FetchSubmodule
///
///
/// Set to true to fetch Git submodules for your CodeBuild build project.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Source_GitSubmodulesConfig_FetchSubmodules")]
public System.Boolean? GitSubmodulesConfig_FetchSubmodule { get; set; }
#endregion
#region Parameter FileSystemLocation
///
///
/// An array of ProjectFileSystemLocation
objects for a CodeBuild build
/// project. A ProjectFileSystemLocation
object specifies the identifier
,
/// location
, mountOptions
, mountPoint
, and type
/// of a file system created using Amazon Elastic File System.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("FileSystemLocations")]
public Amazon.CodeBuild.Model.ProjectFileSystemLocation[] FileSystemLocation { get; set; }
#endregion
#region Parameter Source_GitCloneDepth
///
///
/// Information about the Git clone depth for the build project.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Int32? Source_GitCloneDepth { get; set; }
#endregion
#region Parameter CloudWatchLogs_GroupName
///
///
/// The group name of the logs in CloudWatch Logs. For more information, see Working
/// with Log Groups and Log Streams.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_CloudWatchLogs_GroupName")]
public System.String CloudWatchLogs_GroupName { get; set; }
#endregion
#region Parameter Environment_Image
///
///
/// The image tag or image digest that identifies the Docker image to use for this build
/// project. Use the following formats:- For an image tag:
<registry>/<repository>:<tag>
. For
/// example, in the Docker repository that CodeBuild uses to manage its Docker images,
/// this would be aws/codebuild/standard:4.0
. - For an image digest:
<registry>/<repository>@<digest>
.
/// For example, to specify an image with the digest "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf,"
/// use <registry>/<repository>@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf
.
For more information, see Docker
/// images provided by CodeBuild in the CodeBuild user guide.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String Environment_Image { get; set; }
#endregion
#region Parameter Environment_ImagePullCredentialsType
///
///
/// The type of credentials CodeBuild uses to pull images in your build. There are two
/// valid values: CODEBUILD
specifies that CodeBuild uses its own credentials. This requires
/// that you modify your ECR repository policy to trust CodeBuild service principal. SERVICE_ROLE
specifies that CodeBuild uses your build project's service
/// role.
When you use a cross-account or private registry image, you must use SERVICE_ROLE
/// credentials. When you use an CodeBuild curated image, you must use CODEBUILD credentials.
///
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeBuild.ImagePullCredentialsType")]
public Amazon.CodeBuild.ImagePullCredentialsType Environment_ImagePullCredentialsType { get; set; }
#endregion
#region Parameter Source_InsecureSsl
///
///
/// Enable this flag to ignore SSL warnings while connecting to the project source code.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? Source_InsecureSsl { get; set; }
#endregion
#region Parameter Artifacts_Location
///
///
/// Information about the build output artifact location:- If
type
is set to CODEPIPELINE
, CodePipeline ignores this
/// value if specified. This is because CodePipeline manages its build output locations
/// instead of CodeBuild. - If
type
is set to NO_ARTIFACTS
, this value is ignored if
/// specified, because no build output is produced. - If
type
is set to S3
, this is the name of the output bucket.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Artifacts_Location { get; set; }
#endregion
#region Parameter Cache_Location
///
///
/// Information about the cache location: NO_CACHE
or LOCAL
: This value is ignored.S3
: This is the S3 bucket name/prefix.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Cache_Location { get; set; }
#endregion
#region Parameter S3Logs_Location
///
///
/// The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 bucket
/// name is my-bucket
, and your path prefix is build-log
, then
/// acceptable formats are my-bucket/build-log
or arn:aws:s3:::my-bucket/build-log
.
///
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_S3Logs_Location")]
public System.String S3Logs_Location { get; set; }
#endregion
#region Parameter Source_Location
///
///
/// Information about the location of the source code to be built. Valid values include:- For source code settings that are specified in the source action of a pipeline in
/// CodePipeline,
location
should not be specified. If it is specified, CodePipeline
/// ignores it. This is because CodePipeline uses the settings in a pipeline's source
/// action instead of this value. - For source code in an CodeCommit repository, the HTTPS clone URL to the repository
/// that contains the source code and the buildspec file (for example,
https://git-codecommit.<region-ID>.amazonaws.com/v1/repos/<repo-name>
). - For source code in an Amazon S3 input bucket, one of the following.
- The path to the ZIP file that contains the source code (for example,
<bucket-name>/<path>/<object-name>.zip
).
/// - The path to the folder that contains the source code (for example,
<bucket-name>/<path-to-source-code>/<folder>/
).
///
- For source code in a GitHub repository, the HTTPS clone URL to the repository that
/// contains the source and the buildspec file. You must connect your Amazon Web Services
/// account to your GitHub account. Use the CodeBuild console to start creating a build
/// project. When you use the console to connect (or reconnect) with GitHub, on the GitHub
/// Authorize application page, for Organization access, choose Request
/// access next to each repository you want to allow CodeBuild to have access to,
/// and then choose Authorize application. (After you have connected to your GitHub
/// account, you do not need to finish creating the build project. You can leave the CodeBuild
/// console.) To instruct CodeBuild to use this connection, in the
source
/// object, set the auth
object's type
value to OAUTH
. - For source code in a Bitbucket repository, the HTTPS clone URL to the repository that
/// contains the source and the buildspec file. You must connect your Amazon Web Services
/// account to your Bitbucket account. Use the CodeBuild console to start creating a build
/// project. When you use the console to connect (or reconnect) with Bitbucket, on the
/// Bitbucket Confirm access to your account page, choose Grant access.
/// (After you have connected to your Bitbucket account, you do not need to finish creating
/// the build project. You can leave the CodeBuild console.) To instruct CodeBuild to
/// use this connection, in the
source
object, set the auth
/// object's type
value to OAUTH
.
If you specify CODEPIPELINE
for the Type
property, don't
/// specify this property. For all of the other types, you must specify Location
.
///
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Source_Location { get; set; }
#endregion
#region Parameter Restrictions_MaximumBuildsAllowed
///
///
/// Specifies the maximum number of builds allowed.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("BuildBatchConfig_Restrictions_MaximumBuildsAllowed")]
public System.Int32? Restrictions_MaximumBuildsAllowed { get; set; }
#endregion
#region Parameter Cache_Mode
///
///
/// An array of strings that specify the local cache modes. You can use one or more local
/// cache modes at the same time. This is only used for LOCAL
cache types.Possible values are:- LOCAL_SOURCE_CACHE
- Caches Git metadata for primary and secondary sources. After the cache is created,
/// subsequent builds pull only the change between commits. This mode is a good choice
/// for projects with a clean working directory and a source that is a large Git repository.
/// If you choose this option and your project does not use a Git repository (GitHub,
/// GitHub Enterprise, or Bitbucket), the option is ignored.
- LOCAL_DOCKER_LAYER_CACHE
- Caches existing Docker layers. This mode is a good choice for projects that build
/// or pull large Docker images. It can prevent the performance issues caused by pulling
/// large Docker images down from the network.
- You can use a Docker layer cache in the Linux environment only.
- The
privileged
flag must be set so that your project has the required
/// Docker permissions. - You should consider the security implications before you use a Docker layer cache.
///
- LOCAL_CUSTOM_CACHE
- Caches directories you specify in the buildspec file. This mode is a good choice if
/// your build scenario is not suited to one of the other three local cache modes. If
/// you use a custom cache:
- Only directories can be specified for caching. You cannot specify individual files.
///
- Symlinks are used to reference cached directories.
- Cached directories are linked to your build before it downloads its project sources.
/// Cached items are overridden if a source item has the same name. Directories are specified
/// using cache paths in the buildspec file.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Cache_Modes")]
public System.String[] Cache_Mode { get; set; }
#endregion
#region Parameter Artifacts_Name
///
///
/// Along with path
and namespaceType
, the pattern that CodeBuild
/// uses to name and store the output artifact:- If
type
is set to CODEPIPELINE
, CodePipeline ignores this
/// value if specified. This is because CodePipeline manages its build output names instead
/// of CodeBuild. - If
type
is set to NO_ARTIFACTS
, this value is ignored if
/// specified, because no build output is produced. - If
type
is set to S3
, this is the name of the output artifact
/// object. If you set the name to be a forward slash ("/"), the artifact is stored in
/// the root of the output bucket.
For example:- If
path
is set to MyArtifacts
, namespaceType
/// is set to BUILD_ID
, and name
is set to MyArtifact.zip
,
/// then the output artifact is stored in MyArtifacts/<build-ID>/MyArtifact.zip
.
/// - If
path
is empty, namespaceType
is set to NONE
,
/// and name
is set to "/
", the output artifact is stored in
/// the root of the output bucket. - If
path
is set to MyArtifacts
, namespaceType
/// is set to BUILD_ID
, and name
is set to "/
",
/// the output artifact is stored in MyArtifacts/<build-ID>
.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Artifacts_Name { get; set; }
#endregion
#region Parameter Name
///
///
/// The name of the build project.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]
#else
[System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String Name { get; set; }
#endregion
#region Parameter Artifacts_NamespaceType
///
///
/// Along with path
and name
, the pattern that CodeBuild uses
/// to determine the name and location to store the output artifact:- If
type
is set to CODEPIPELINE
, CodePipeline ignores this
/// value if specified. This is because CodePipeline manages its build output names instead
/// of CodeBuild. - If
type
is set to NO_ARTIFACTS
, this value is ignored if
/// specified, because no build output is produced. - If
type
is set to S3
, valid values include:BUILD_ID
: Include the build ID in the location of the build output artifact.NONE
: Do not include the build ID. This is the default if namespaceType
/// is not specified.
For example, if path
is set to MyArtifacts
, namespaceType
/// is set to BUILD_ID
, and name
is set to MyArtifact.zip
,
/// the output artifact is stored in MyArtifacts/<build-ID>/MyArtifact.zip
.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeBuild.ArtifactNamespace")]
public Amazon.CodeBuild.ArtifactNamespace Artifacts_NamespaceType { get; set; }
#endregion
#region Parameter Artifacts_OverrideArtifactName
///
///
/// If this flag is set, a name specified in the buildspec file overrides the artifact
/// name. The name specified in a buildspec file is calculated at build time and uses
/// the Shell Command Language. For example, you can append a date and time to your artifact
/// name so that it is always unique.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? Artifacts_OverrideArtifactName { get; set; }
#endregion
#region Parameter Artifacts_Packaging
///
///
/// The type of build output artifact to create:- If
type
is set to CODEPIPELINE
, CodePipeline ignores this
/// value if specified. This is because CodePipeline manages its build output artifacts
/// instead of CodeBuild. - If
type
is set to NO_ARTIFACTS
, this value is ignored if
/// specified, because no build output is produced. - If
type
is set to S3
, valid values include:NONE
: CodeBuild creates in the output bucket a folder that contains
/// the build output. This is the default if packaging
is not specified.ZIP
: CodeBuild creates in the output bucket a ZIP file that contains
/// the build output.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeBuild.ArtifactPackaging")]
public Amazon.CodeBuild.ArtifactPackaging Artifacts_Packaging { get; set; }
#endregion
#region Parameter Artifacts_Path
///
///
/// Along with namespaceType
and name
, the pattern that CodeBuild
/// uses to name and store the output artifact:- If
type
is set to CODEPIPELINE
, CodePipeline ignores this
/// value if specified. This is because CodePipeline manages its build output names instead
/// of CodeBuild. - If
type
is set to NO_ARTIFACTS
, this value is ignored if
/// specified, because no build output is produced. - If
type
is set to S3
, this is the path to the output artifact.
/// If path
is not specified, path
is not used.
For example, if path
is set to MyArtifacts
, namespaceType
/// is set to NONE
, and name
is set to MyArtifact.zip
,
/// the output artifact is stored in the output bucket at MyArtifacts/MyArtifact.zip
.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Artifacts_Path { get; set; }
#endregion
#region Parameter Environment_PrivilegedMode
///
///
/// Enables running the Docker daemon inside a Docker container. Set to true only if the
/// build project is used to build Docker images. Otherwise, a build that attempts to
/// interact with the Docker daemon fails. The default setting is false
.You can initialize the Docker daemon during the install phase of your build by adding
/// one of the following sets of commands to the install phase of your buildspec file:If the operating system's base image is Ubuntu Linux:- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375
/// --storage-driver=overlay&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
If the operating system's base image is Alpine Linux and the previous command does
/// not work, add the -t
argument to timeout
:- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375
/// --storage-driver=overlay&
- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? Environment_PrivilegedMode { get; set; }
#endregion
#region Parameter QueuedTimeoutInMinute
///
///
/// The number of minutes a build is allowed to be queued before it times out.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("QueuedTimeoutInMinutes")]
public System.Int32? QueuedTimeoutInMinute { get; set; }
#endregion
#region Parameter Source_ReportBuildStatus
///
///
/// Set to true to report the status of a build's start and finish to your source provider.
/// This option is valid only when your source provider is GitHub, GitHub Enterprise,
/// or Bitbucket. If this is set and you use a different source provider, an invalidInputException
/// is thrown. To be able to report the build status to the source provider, the user associated
/// with the source provider must have write access to the repo. If the user does not
/// have write access, the build status cannot be updated. For more information, see Source
/// provider access in the CodeBuild User Guide.The status of a build triggered by a webhook is always reported to your source provider.
/// If your project's builds are triggered by a webhook, you must push a new commit to
/// the repo for a change to this property to take effect.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? Source_ReportBuildStatus { get; set; }
#endregion
#region Parameter Auth_Resource
///
///
/// The resource value that applies to the specified authorization type.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Source_Auth_Resource")]
public System.String Auth_Resource { get; set; }
#endregion
#region Parameter SecondaryArtifact
///
///
/// An array of ProjectArtifacts
objects.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("SecondaryArtifacts")]
public Amazon.CodeBuild.Model.ProjectArtifacts[] SecondaryArtifact { get; set; }
#endregion
#region Parameter SecondarySource
///
///
/// An array of ProjectSource
objects.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("SecondarySources")]
public Amazon.CodeBuild.Model.ProjectSource[] SecondarySource { get; set; }
#endregion
#region Parameter SecondarySourceVersion
///
///
/// An array of ProjectSourceVersion
objects. If secondarySourceVersions
/// is specified at the build level, then they take precedence over these secondarySourceVersions
/// (at the project level).
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("SecondarySourceVersions")]
public Amazon.CodeBuild.Model.ProjectSourceVersion[] SecondarySourceVersion { get; set; }
#endregion
#region Parameter VpcConfig_SecurityGroupId
///
///
/// A list of one or more security groups IDs in your Amazon VPC.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("VpcConfig_SecurityGroupIds")]
public System.String[] VpcConfig_SecurityGroupId { get; set; }
#endregion
#region Parameter BuildBatchConfig_ServiceRole
///
///
/// Specifies the service role ARN for the batch build project.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String BuildBatchConfig_ServiceRole { get; set; }
#endregion
#region Parameter ServiceRole
///
///
/// The ARN of the IAM role that enables CodeBuild to interact with dependent Amazon Web
/// Services services on behalf of the Amazon Web Services account.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String ServiceRole { get; set; }
#endregion
#region Parameter Source_SourceIdentifier
///
///
/// An identifier for this project source. The identifier can only contain alphanumeric
/// characters and underscores, and must be less than 128 characters in length.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String Source_SourceIdentifier { get; set; }
#endregion
#region Parameter SourceVersion
///
///
/// A version of the build input to be built for this project. If not specified, the latest
/// version is used. If specified, it must be one of: - For CodeCommit: the commit ID, branch, or Git tag to use.
- For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds
/// to the version of the source code you want to build. If a pull request ID is specified,
/// it must use the format
pr/pull-request-ID
(for example pr/25
).
/// If a branch name is specified, the branch's HEAD commit ID is used. If not specified,
/// the default branch's HEAD commit ID is used. - For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version
/// of the source code you want to build. If a branch name is specified, the branch's
/// HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.
- For Amazon S3: the version ID of the object that represents the build input ZIP file
/// to use.
If sourceVersion
is specified at the build level, then that version takes
/// precedence over this sourceVersion
(at the project level). For more information, see Source
/// Version Sample with CodeBuild in the CodeBuild User Guide.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String SourceVersion { get; set; }
#endregion
#region Parameter CloudWatchLogs_Status
///
///
/// The current status of the logs in CloudWatch Logs for a build project. Valid values
/// are:ENABLED
: CloudWatch Logs are enabled for this build project.DISABLED
: CloudWatch Logs are not enabled for this build project.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_CloudWatchLogs_Status")]
[AWSConstantClassSource("Amazon.CodeBuild.LogsConfigStatusType")]
public Amazon.CodeBuild.LogsConfigStatusType CloudWatchLogs_Status { get; set; }
#endregion
#region Parameter S3Logs_Status
///
///
/// The current status of the S3 build logs. Valid values are:ENABLED
: S3 build logs are enabled for this build project.DISABLED
: S3 build logs are not enabled for this build project.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_S3Logs_Status")]
[AWSConstantClassSource("Amazon.CodeBuild.LogsConfigStatusType")]
public Amazon.CodeBuild.LogsConfigStatusType S3Logs_Status { get; set; }
#endregion
#region Parameter CloudWatchLogs_StreamName
///
///
/// The prefix of the stream name of the CloudWatch Logs. For more information, see Working
/// with Log Groups and Log Streams.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("LogsConfig_CloudWatchLogs_StreamName")]
public System.String CloudWatchLogs_StreamName { get; set; }
#endregion
#region Parameter VpcConfig_Subnet
///
///
/// A list of one or more subnet IDs in your Amazon VPC.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("VpcConfig_Subnets")]
public System.String[] VpcConfig_Subnet { get; set; }
#endregion
#region Parameter Tag
///
///
/// A list of tag key and value pairs associated with this build project.These tags are available for use by Amazon Web Services services that support CodeBuild
/// build project tags.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Tags")]
public Amazon.CodeBuild.Model.Tag[] Tag { get; set; }
#endregion
#region Parameter BuildStatusConfig_TargetUrl
///
///
/// Specifies the target url of the build status CodeBuild sends to the source provider.
/// The usage of this parameter depends on the source provider.- Bitbucket
- This parameter is used for the
url
parameter in the Bitbucket commit
/// status. For more information, see build
/// in the Bitbucket API documentation. - GitHub/GitHub Enterprise Server
- This parameter is used for the
target_url
parameter in the GitHub commit
/// status. For more information, see Create
/// a commit status in the GitHub developer guide.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Source_BuildStatusConfig_TargetUrl")]
public System.String BuildStatusConfig_TargetUrl { get; set; }
#endregion
#region Parameter BuildBatchConfig_TimeoutInMin
///
///
/// Specifies the maximum amount of time, in minutes, that the batch build must be completed
/// in.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("BuildBatchConfig_TimeoutInMins")]
public System.Int32? BuildBatchConfig_TimeoutInMin { get; set; }
#endregion
#region Parameter TimeoutInMinute
///
///
/// How long, in minutes, from 5 to 480 (8 hours), for CodeBuild to wait before it times
/// out any build that has not been marked as completed. The default is 60 minutes.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("TimeoutInMinutes")]
public System.Int32? TimeoutInMinute { get; set; }
#endregion
#region Parameter Artifacts_Type
///
///
/// The type of build output artifact. Valid values include:CODEPIPELINE
: The build project has build output generated through CodePipeline.
/// The CODEPIPELINE
type is not supported for secondaryArtifacts
.NO_ARTIFACTS
: The build project does not produce any build output.S3
: The build project stores build output in Amazon S3.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
[AWSConstantClassSource("Amazon.CodeBuild.ArtifactsType")]
public Amazon.CodeBuild.ArtifactsType Artifacts_Type { get; set; }
#endregion
#region Parameter Cache_Type
///
///
/// The type of cache used by the build project. Valid values include:NO_CACHE
: The build project does not use any cache.S3
: The build project reads and writes from and to S3.LOCAL
: The build project stores a cache locally on a build host that
/// is only available to that build host.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.CodeBuild.CacheType")]
public Amazon.CodeBuild.CacheType Cache_Type { get; set; }
#endregion
#region Parameter Environment_Type
///
///
/// The type of build environment to use for related builds.- The environment type
ARM_CONTAINER
is available only in regions US East
/// (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai),
/// Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt). - The environment type
LINUX_CONTAINER
with compute type build.general1.2xlarge
/// is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon),
/// Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo),
/// Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), China (Beijing),
/// and China (Ningxia). - The environment type
LINUX_GPU_CONTAINER
is available only in regions
/// US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), EU (Ireland),
/// EU (London), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific
/// (Singapore), Asia Pacific (Sydney) , China (Beijing), and China (Ningxia).
- The environment types
WINDOWS_CONTAINER
and WINDOWS_SERVER_2019_CONTAINER
/// are available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon),
/// and EU (Ireland).
For more information, see Build
/// environment compute types in the CodeBuild user guide.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
[AWSConstantClassSource("Amazon.CodeBuild.EnvironmentType")]
public Amazon.CodeBuild.EnvironmentType Environment_Type { get; set; }
#endregion
#region Parameter Auth_Type
///
///
/// This data type is deprecated and is no longer accurate or used. The authorization type to use. The only valid value is OAUTH
, which represents
/// the OAuth authorization type.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Source_Auth_Type")]
[AWSConstantClassSource("Amazon.CodeBuild.SourceAuthType")]
public Amazon.CodeBuild.SourceAuthType Auth_Type { get; set; }
#endregion
#region Parameter Source_Type
///
///
/// The type of repository that contains the source code to be built. Valid values include:BITBUCKET
: The source code is in a Bitbucket repository.CODECOMMIT
: The source code is in an CodeCommit repository.CODEPIPELINE
: The source code settings are specified in the source action
/// of a pipeline in CodePipeline.GITHUB
: The source code is in a GitHub or GitHub Enterprise Cloud repository.GITHUB_ENTERPRISE
: The source code is in a GitHub Enterprise Server
/// repository.NO_SOURCE
: The project does not have input source code.S3
: The source code is in an Amazon S3 bucket.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
[AWSConstantClassSource("Amazon.CodeBuild.SourceType")]
public Amazon.CodeBuild.SourceType Source_Type { get; set; }
#endregion
#region Parameter VpcConfig_VpcId
///
///
/// The ID of the Amazon VPC.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String VpcConfig_VpcId { get; set; }
#endregion
#region Parameter Select
///
/// Use the -Select parameter to control the cmdlet output. The default value is 'Project'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.CodeBuild.Model.CreateProjectResponse).
/// Specifying the name of a property of type Amazon.CodeBuild.Model.CreateProjectResponse will result in that property being returned.
/// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public string Select { get; set; } = "Project";
#endregion
#region Parameter PassThru
///
/// Changes the cmdlet behavior to return the value passed to the Name parameter.
/// The -PassThru parameter is deprecated, use -Select '^Name' instead. This parameter will be removed in a future version.
///
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^Name' instead. This parameter will be removed in a future version.")]
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter PassThru { get; set; }
#endregion
#region Parameter Force
///
/// This parameter overrides confirmation prompts to force
/// the cmdlet to continue its operation. This parameter should always
/// be used with caution.
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public SwitchParameter Force { get; set; }
#endregion
protected override void ProcessRecord()
{
this._AWSSignerType = "v4";
base.ProcessRecord();
var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.Name), MyInvocation.BoundParameters);
if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "New-CBProject (CreateProject)"))
{
return;
}
var context = new CmdletContext();
// allow for manipulation of parameters prior to loading into context
PreExecutionContextLoad(context);
#pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
if (ParameterWasBound(nameof(this.Select)))
{
context.Select = CreateSelectDelegate(Select) ??
throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select));
if (this.PassThru.IsPresent)
{
throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select));
}
}
else if (this.PassThru.IsPresent)
{
context.Select = (response, cmdlet) => this.Name;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.Artifacts_ArtifactIdentifier = this.Artifacts_ArtifactIdentifier;
context.Artifacts_BucketOwnerAccess = this.Artifacts_BucketOwnerAccess;
context.Artifacts_EncryptionDisabled = this.Artifacts_EncryptionDisabled;
context.Artifacts_Location = this.Artifacts_Location;
context.Artifacts_Name = this.Artifacts_Name;
context.Artifacts_NamespaceType = this.Artifacts_NamespaceType;
context.Artifacts_OverrideArtifactName = this.Artifacts_OverrideArtifactName;
context.Artifacts_Packaging = this.Artifacts_Packaging;
context.Artifacts_Path = this.Artifacts_Path;
context.Artifacts_Type = this.Artifacts_Type;
#if MODULAR
if (this.Artifacts_Type == null && ParameterWasBound(nameof(this.Artifacts_Type)))
{
WriteWarning("You are passing $null as a value for parameter Artifacts_Type which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.BadgeEnabled = this.BadgeEnabled;
context.BuildBatchConfig_BatchReportMode = this.BuildBatchConfig_BatchReportMode;
context.BuildBatchConfig_CombineArtifact = this.BuildBatchConfig_CombineArtifact;
if (this.Restrictions_ComputeTypesAllowed != null)
{
context.Restrictions_ComputeTypesAllowed = new List(this.Restrictions_ComputeTypesAllowed);
}
context.Restrictions_MaximumBuildsAllowed = this.Restrictions_MaximumBuildsAllowed;
context.BuildBatchConfig_ServiceRole = this.BuildBatchConfig_ServiceRole;
context.BuildBatchConfig_TimeoutInMin = this.BuildBatchConfig_TimeoutInMin;
context.Cache_Location = this.Cache_Location;
if (this.Cache_Mode != null)
{
context.Cache_Mode = new List(this.Cache_Mode);
}
context.Cache_Type = this.Cache_Type;
context.ConcurrentBuildLimit = this.ConcurrentBuildLimit;
context.Description = this.Description;
context.EncryptionKey = this.EncryptionKey;
context.Environment_Certificate = this.Environment_Certificate;
context.Environment_ComputeType = this.Environment_ComputeType;
#if MODULAR
if (this.Environment_ComputeType == null && ParameterWasBound(nameof(this.Environment_ComputeType)))
{
WriteWarning("You are passing $null as a value for parameter Environment_ComputeType which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
if (this.Environment_EnvironmentVariable != null)
{
context.Environment_EnvironmentVariable = new List(this.Environment_EnvironmentVariable);
}
context.Environment_Image = this.Environment_Image;
#if MODULAR
if (this.Environment_Image == null && ParameterWasBound(nameof(this.Environment_Image)))
{
WriteWarning("You are passing $null as a value for parameter Environment_Image which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.Environment_ImagePullCredentialsType = this.Environment_ImagePullCredentialsType;
context.Environment_PrivilegedMode = this.Environment_PrivilegedMode;
context.RegistryCredential_Credential = this.RegistryCredential_Credential;
context.RegistryCredential_CredentialProvider = this.RegistryCredential_CredentialProvider;
context.Environment_Type = this.Environment_Type;
#if MODULAR
if (this.Environment_Type == null && ParameterWasBound(nameof(this.Environment_Type)))
{
WriteWarning("You are passing $null as a value for parameter Environment_Type which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
if (this.FileSystemLocation != null)
{
context.FileSystemLocation = new List(this.FileSystemLocation);
}
context.CloudWatchLogs_GroupName = this.CloudWatchLogs_GroupName;
context.CloudWatchLogs_Status = this.CloudWatchLogs_Status;
context.CloudWatchLogs_StreamName = this.CloudWatchLogs_StreamName;
context.S3Logs_BucketOwnerAccess = this.S3Logs_BucketOwnerAccess;
context.S3Logs_EncryptionDisabled = this.S3Logs_EncryptionDisabled;
context.S3Logs_Location = this.S3Logs_Location;
context.S3Logs_Status = this.S3Logs_Status;
context.Name = this.Name;
#if MODULAR
if (this.Name == null && ParameterWasBound(nameof(this.Name)))
{
WriteWarning("You are passing $null as a value for parameter Name which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.QueuedTimeoutInMinute = this.QueuedTimeoutInMinute;
if (this.SecondaryArtifact != null)
{
context.SecondaryArtifact = new List(this.SecondaryArtifact);
}
if (this.SecondarySource != null)
{
context.SecondarySource = new List(this.SecondarySource);
}
if (this.SecondarySourceVersion != null)
{
context.SecondarySourceVersion = new List(this.SecondarySourceVersion);
}
context.ServiceRole = this.ServiceRole;
#if MODULAR
if (this.ServiceRole == null && ParameterWasBound(nameof(this.ServiceRole)))
{
WriteWarning("You are passing $null as a value for parameter ServiceRole which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.Auth_Resource = this.Auth_Resource;
context.Auth_Type = this.Auth_Type;
context.Source_Buildspec = this.Source_Buildspec;
context.BuildStatusConfig_Context = this.BuildStatusConfig_Context;
context.BuildStatusConfig_TargetUrl = this.BuildStatusConfig_TargetUrl;
context.Source_GitCloneDepth = this.Source_GitCloneDepth;
context.GitSubmodulesConfig_FetchSubmodule = this.GitSubmodulesConfig_FetchSubmodule;
context.Source_InsecureSsl = this.Source_InsecureSsl;
context.Source_Location = this.Source_Location;
context.Source_ReportBuildStatus = this.Source_ReportBuildStatus;
context.Source_SourceIdentifier = this.Source_SourceIdentifier;
context.Source_Type = this.Source_Type;
#if MODULAR
if (this.Source_Type == null && ParameterWasBound(nameof(this.Source_Type)))
{
WriteWarning("You are passing $null as a value for parameter Source_Type which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues.");
}
#endif
context.SourceVersion = this.SourceVersion;
if (this.Tag != null)
{
context.Tag = new List(this.Tag);
}
context.TimeoutInMinute = this.TimeoutInMinute;
if (this.VpcConfig_SecurityGroupId != null)
{
context.VpcConfig_SecurityGroupId = new List(this.VpcConfig_SecurityGroupId);
}
if (this.VpcConfig_Subnet != null)
{
context.VpcConfig_Subnet = new List(this.VpcConfig_Subnet);
}
context.VpcConfig_VpcId = this.VpcConfig_VpcId;
// allow further manipulation of loaded context prior to processing
PostExecutionContextLoad(context);
var output = Execute(context) as CmdletOutput;
ProcessOutput(output);
}
#region IExecutor Members
public object Execute(ExecutorContext context)
{
var cmdletContext = context as CmdletContext;
// create request
var request = new Amazon.CodeBuild.Model.CreateProjectRequest();
// populate Artifacts
var requestArtifactsIsNull = true;
request.Artifacts = new Amazon.CodeBuild.Model.ProjectArtifacts();
System.String requestArtifacts_artifacts_ArtifactIdentifier = null;
if (cmdletContext.Artifacts_ArtifactIdentifier != null)
{
requestArtifacts_artifacts_ArtifactIdentifier = cmdletContext.Artifacts_ArtifactIdentifier;
}
if (requestArtifacts_artifacts_ArtifactIdentifier != null)
{
request.Artifacts.ArtifactIdentifier = requestArtifacts_artifacts_ArtifactIdentifier;
requestArtifactsIsNull = false;
}
Amazon.CodeBuild.BucketOwnerAccess requestArtifacts_artifacts_BucketOwnerAccess = null;
if (cmdletContext.Artifacts_BucketOwnerAccess != null)
{
requestArtifacts_artifacts_BucketOwnerAccess = cmdletContext.Artifacts_BucketOwnerAccess;
}
if (requestArtifacts_artifacts_BucketOwnerAccess != null)
{
request.Artifacts.BucketOwnerAccess = requestArtifacts_artifacts_BucketOwnerAccess;
requestArtifactsIsNull = false;
}
System.Boolean? requestArtifacts_artifacts_EncryptionDisabled = null;
if (cmdletContext.Artifacts_EncryptionDisabled != null)
{
requestArtifacts_artifacts_EncryptionDisabled = cmdletContext.Artifacts_EncryptionDisabled.Value;
}
if (requestArtifacts_artifacts_EncryptionDisabled != null)
{
request.Artifacts.EncryptionDisabled = requestArtifacts_artifacts_EncryptionDisabled.Value;
requestArtifactsIsNull = false;
}
System.String requestArtifacts_artifacts_Location = null;
if (cmdletContext.Artifacts_Location != null)
{
requestArtifacts_artifacts_Location = cmdletContext.Artifacts_Location;
}
if (requestArtifacts_artifacts_Location != null)
{
request.Artifacts.Location = requestArtifacts_artifacts_Location;
requestArtifactsIsNull = false;
}
System.String requestArtifacts_artifacts_Name = null;
if (cmdletContext.Artifacts_Name != null)
{
requestArtifacts_artifacts_Name = cmdletContext.Artifacts_Name;
}
if (requestArtifacts_artifacts_Name != null)
{
request.Artifacts.Name = requestArtifacts_artifacts_Name;
requestArtifactsIsNull = false;
}
Amazon.CodeBuild.ArtifactNamespace requestArtifacts_artifacts_NamespaceType = null;
if (cmdletContext.Artifacts_NamespaceType != null)
{
requestArtifacts_artifacts_NamespaceType = cmdletContext.Artifacts_NamespaceType;
}
if (requestArtifacts_artifacts_NamespaceType != null)
{
request.Artifacts.NamespaceType = requestArtifacts_artifacts_NamespaceType;
requestArtifactsIsNull = false;
}
System.Boolean? requestArtifacts_artifacts_OverrideArtifactName = null;
if (cmdletContext.Artifacts_OverrideArtifactName != null)
{
requestArtifacts_artifacts_OverrideArtifactName = cmdletContext.Artifacts_OverrideArtifactName.Value;
}
if (requestArtifacts_artifacts_OverrideArtifactName != null)
{
request.Artifacts.OverrideArtifactName = requestArtifacts_artifacts_OverrideArtifactName.Value;
requestArtifactsIsNull = false;
}
Amazon.CodeBuild.ArtifactPackaging requestArtifacts_artifacts_Packaging = null;
if (cmdletContext.Artifacts_Packaging != null)
{
requestArtifacts_artifacts_Packaging = cmdletContext.Artifacts_Packaging;
}
if (requestArtifacts_artifacts_Packaging != null)
{
request.Artifacts.Packaging = requestArtifacts_artifacts_Packaging;
requestArtifactsIsNull = false;
}
System.String requestArtifacts_artifacts_Path = null;
if (cmdletContext.Artifacts_Path != null)
{
requestArtifacts_artifacts_Path = cmdletContext.Artifacts_Path;
}
if (requestArtifacts_artifacts_Path != null)
{
request.Artifacts.Path = requestArtifacts_artifacts_Path;
requestArtifactsIsNull = false;
}
Amazon.CodeBuild.ArtifactsType requestArtifacts_artifacts_Type = null;
if (cmdletContext.Artifacts_Type != null)
{
requestArtifacts_artifacts_Type = cmdletContext.Artifacts_Type;
}
if (requestArtifacts_artifacts_Type != null)
{
request.Artifacts.Type = requestArtifacts_artifacts_Type;
requestArtifactsIsNull = false;
}
// determine if request.Artifacts should be set to null
if (requestArtifactsIsNull)
{
request.Artifacts = null;
}
if (cmdletContext.BadgeEnabled != null)
{
request.BadgeEnabled = cmdletContext.BadgeEnabled.Value;
}
// populate BuildBatchConfig
var requestBuildBatchConfigIsNull = true;
request.BuildBatchConfig = new Amazon.CodeBuild.Model.ProjectBuildBatchConfig();
Amazon.CodeBuild.BatchReportModeType requestBuildBatchConfig_buildBatchConfig_BatchReportMode = null;
if (cmdletContext.BuildBatchConfig_BatchReportMode != null)
{
requestBuildBatchConfig_buildBatchConfig_BatchReportMode = cmdletContext.BuildBatchConfig_BatchReportMode;
}
if (requestBuildBatchConfig_buildBatchConfig_BatchReportMode != null)
{
request.BuildBatchConfig.BatchReportMode = requestBuildBatchConfig_buildBatchConfig_BatchReportMode;
requestBuildBatchConfigIsNull = false;
}
System.Boolean? requestBuildBatchConfig_buildBatchConfig_CombineArtifact = null;
if (cmdletContext.BuildBatchConfig_CombineArtifact != null)
{
requestBuildBatchConfig_buildBatchConfig_CombineArtifact = cmdletContext.BuildBatchConfig_CombineArtifact.Value;
}
if (requestBuildBatchConfig_buildBatchConfig_CombineArtifact != null)
{
request.BuildBatchConfig.CombineArtifacts = requestBuildBatchConfig_buildBatchConfig_CombineArtifact.Value;
requestBuildBatchConfigIsNull = false;
}
System.String requestBuildBatchConfig_buildBatchConfig_ServiceRole = null;
if (cmdletContext.BuildBatchConfig_ServiceRole != null)
{
requestBuildBatchConfig_buildBatchConfig_ServiceRole = cmdletContext.BuildBatchConfig_ServiceRole;
}
if (requestBuildBatchConfig_buildBatchConfig_ServiceRole != null)
{
request.BuildBatchConfig.ServiceRole = requestBuildBatchConfig_buildBatchConfig_ServiceRole;
requestBuildBatchConfigIsNull = false;
}
System.Int32? requestBuildBatchConfig_buildBatchConfig_TimeoutInMin = null;
if (cmdletContext.BuildBatchConfig_TimeoutInMin != null)
{
requestBuildBatchConfig_buildBatchConfig_TimeoutInMin = cmdletContext.BuildBatchConfig_TimeoutInMin.Value;
}
if (requestBuildBatchConfig_buildBatchConfig_TimeoutInMin != null)
{
request.BuildBatchConfig.TimeoutInMins = requestBuildBatchConfig_buildBatchConfig_TimeoutInMin.Value;
requestBuildBatchConfigIsNull = false;
}
Amazon.CodeBuild.Model.BatchRestrictions requestBuildBatchConfig_buildBatchConfig_Restrictions = null;
// populate Restrictions
var requestBuildBatchConfig_buildBatchConfig_RestrictionsIsNull = true;
requestBuildBatchConfig_buildBatchConfig_Restrictions = new Amazon.CodeBuild.Model.BatchRestrictions();
List requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_ComputeTypesAllowed = null;
if (cmdletContext.Restrictions_ComputeTypesAllowed != null)
{
requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_ComputeTypesAllowed = cmdletContext.Restrictions_ComputeTypesAllowed;
}
if (requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_ComputeTypesAllowed != null)
{
requestBuildBatchConfig_buildBatchConfig_Restrictions.ComputeTypesAllowed = requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_ComputeTypesAllowed;
requestBuildBatchConfig_buildBatchConfig_RestrictionsIsNull = false;
}
System.Int32? requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_MaximumBuildsAllowed = null;
if (cmdletContext.Restrictions_MaximumBuildsAllowed != null)
{
requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_MaximumBuildsAllowed = cmdletContext.Restrictions_MaximumBuildsAllowed.Value;
}
if (requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_MaximumBuildsAllowed != null)
{
requestBuildBatchConfig_buildBatchConfig_Restrictions.MaximumBuildsAllowed = requestBuildBatchConfig_buildBatchConfig_Restrictions_restrictions_MaximumBuildsAllowed.Value;
requestBuildBatchConfig_buildBatchConfig_RestrictionsIsNull = false;
}
// determine if requestBuildBatchConfig_buildBatchConfig_Restrictions should be set to null
if (requestBuildBatchConfig_buildBatchConfig_RestrictionsIsNull)
{
requestBuildBatchConfig_buildBatchConfig_Restrictions = null;
}
if (requestBuildBatchConfig_buildBatchConfig_Restrictions != null)
{
request.BuildBatchConfig.Restrictions = requestBuildBatchConfig_buildBatchConfig_Restrictions;
requestBuildBatchConfigIsNull = false;
}
// determine if request.BuildBatchConfig should be set to null
if (requestBuildBatchConfigIsNull)
{
request.BuildBatchConfig = null;
}
// populate Cache
var requestCacheIsNull = true;
request.Cache = new Amazon.CodeBuild.Model.ProjectCache();
System.String requestCache_cache_Location = null;
if (cmdletContext.Cache_Location != null)
{
requestCache_cache_Location = cmdletContext.Cache_Location;
}
if (requestCache_cache_Location != null)
{
request.Cache.Location = requestCache_cache_Location;
requestCacheIsNull = false;
}
List requestCache_cache_Mode = null;
if (cmdletContext.Cache_Mode != null)
{
requestCache_cache_Mode = cmdletContext.Cache_Mode;
}
if (requestCache_cache_Mode != null)
{
request.Cache.Modes = requestCache_cache_Mode;
requestCacheIsNull = false;
}
Amazon.CodeBuild.CacheType requestCache_cache_Type = null;
if (cmdletContext.Cache_Type != null)
{
requestCache_cache_Type = cmdletContext.Cache_Type;
}
if (requestCache_cache_Type != null)
{
request.Cache.Type = requestCache_cache_Type;
requestCacheIsNull = false;
}
// determine if request.Cache should be set to null
if (requestCacheIsNull)
{
request.Cache = null;
}
if (cmdletContext.ConcurrentBuildLimit != null)
{
request.ConcurrentBuildLimit = cmdletContext.ConcurrentBuildLimit.Value;
}
if (cmdletContext.Description != null)
{
request.Description = cmdletContext.Description;
}
if (cmdletContext.EncryptionKey != null)
{
request.EncryptionKey = cmdletContext.EncryptionKey;
}
// populate Environment
var requestEnvironmentIsNull = true;
request.Environment = new Amazon.CodeBuild.Model.ProjectEnvironment();
System.String requestEnvironment_environment_Certificate = null;
if (cmdletContext.Environment_Certificate != null)
{
requestEnvironment_environment_Certificate = cmdletContext.Environment_Certificate;
}
if (requestEnvironment_environment_Certificate != null)
{
request.Environment.Certificate = requestEnvironment_environment_Certificate;
requestEnvironmentIsNull = false;
}
Amazon.CodeBuild.ComputeType requestEnvironment_environment_ComputeType = null;
if (cmdletContext.Environment_ComputeType != null)
{
requestEnvironment_environment_ComputeType = cmdletContext.Environment_ComputeType;
}
if (requestEnvironment_environment_ComputeType != null)
{
request.Environment.ComputeType = requestEnvironment_environment_ComputeType;
requestEnvironmentIsNull = false;
}
List requestEnvironment_environment_EnvironmentVariable = null;
if (cmdletContext.Environment_EnvironmentVariable != null)
{
requestEnvironment_environment_EnvironmentVariable = cmdletContext.Environment_EnvironmentVariable;
}
if (requestEnvironment_environment_EnvironmentVariable != null)
{
request.Environment.EnvironmentVariables = requestEnvironment_environment_EnvironmentVariable;
requestEnvironmentIsNull = false;
}
System.String requestEnvironment_environment_Image = null;
if (cmdletContext.Environment_Image != null)
{
requestEnvironment_environment_Image = cmdletContext.Environment_Image;
}
if (requestEnvironment_environment_Image != null)
{
request.Environment.Image = requestEnvironment_environment_Image;
requestEnvironmentIsNull = false;
}
Amazon.CodeBuild.ImagePullCredentialsType requestEnvironment_environment_ImagePullCredentialsType = null;
if (cmdletContext.Environment_ImagePullCredentialsType != null)
{
requestEnvironment_environment_ImagePullCredentialsType = cmdletContext.Environment_ImagePullCredentialsType;
}
if (requestEnvironment_environment_ImagePullCredentialsType != null)
{
request.Environment.ImagePullCredentialsType = requestEnvironment_environment_ImagePullCredentialsType;
requestEnvironmentIsNull = false;
}
System.Boolean? requestEnvironment_environment_PrivilegedMode = null;
if (cmdletContext.Environment_PrivilegedMode != null)
{
requestEnvironment_environment_PrivilegedMode = cmdletContext.Environment_PrivilegedMode.Value;
}
if (requestEnvironment_environment_PrivilegedMode != null)
{
request.Environment.PrivilegedMode = requestEnvironment_environment_PrivilegedMode.Value;
requestEnvironmentIsNull = false;
}
Amazon.CodeBuild.EnvironmentType requestEnvironment_environment_Type = null;
if (cmdletContext.Environment_Type != null)
{
requestEnvironment_environment_Type = cmdletContext.Environment_Type;
}
if (requestEnvironment_environment_Type != null)
{
request.Environment.Type = requestEnvironment_environment_Type;
requestEnvironmentIsNull = false;
}
Amazon.CodeBuild.Model.RegistryCredential requestEnvironment_environment_RegistryCredential = null;
// populate RegistryCredential
var requestEnvironment_environment_RegistryCredentialIsNull = true;
requestEnvironment_environment_RegistryCredential = new Amazon.CodeBuild.Model.RegistryCredential();
System.String requestEnvironment_environment_RegistryCredential_registryCredential_Credential = null;
if (cmdletContext.RegistryCredential_Credential != null)
{
requestEnvironment_environment_RegistryCredential_registryCredential_Credential = cmdletContext.RegistryCredential_Credential;
}
if (requestEnvironment_environment_RegistryCredential_registryCredential_Credential != null)
{
requestEnvironment_environment_RegistryCredential.Credential = requestEnvironment_environment_RegistryCredential_registryCredential_Credential;
requestEnvironment_environment_RegistryCredentialIsNull = false;
}
Amazon.CodeBuild.CredentialProviderType requestEnvironment_environment_RegistryCredential_registryCredential_CredentialProvider = null;
if (cmdletContext.RegistryCredential_CredentialProvider != null)
{
requestEnvironment_environment_RegistryCredential_registryCredential_CredentialProvider = cmdletContext.RegistryCredential_CredentialProvider;
}
if (requestEnvironment_environment_RegistryCredential_registryCredential_CredentialProvider != null)
{
requestEnvironment_environment_RegistryCredential.CredentialProvider = requestEnvironment_environment_RegistryCredential_registryCredential_CredentialProvider;
requestEnvironment_environment_RegistryCredentialIsNull = false;
}
// determine if requestEnvironment_environment_RegistryCredential should be set to null
if (requestEnvironment_environment_RegistryCredentialIsNull)
{
requestEnvironment_environment_RegistryCredential = null;
}
if (requestEnvironment_environment_RegistryCredential != null)
{
request.Environment.RegistryCredential = requestEnvironment_environment_RegistryCredential;
requestEnvironmentIsNull = false;
}
// determine if request.Environment should be set to null
if (requestEnvironmentIsNull)
{
request.Environment = null;
}
if (cmdletContext.FileSystemLocation != null)
{
request.FileSystemLocations = cmdletContext.FileSystemLocation;
}
// populate LogsConfig
var requestLogsConfigIsNull = true;
request.LogsConfig = new Amazon.CodeBuild.Model.LogsConfig();
Amazon.CodeBuild.Model.CloudWatchLogsConfig requestLogsConfig_logsConfig_CloudWatchLogs = null;
// populate CloudWatchLogs
var requestLogsConfig_logsConfig_CloudWatchLogsIsNull = true;
requestLogsConfig_logsConfig_CloudWatchLogs = new Amazon.CodeBuild.Model.CloudWatchLogsConfig();
System.String requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_GroupName = null;
if (cmdletContext.CloudWatchLogs_GroupName != null)
{
requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_GroupName = cmdletContext.CloudWatchLogs_GroupName;
}
if (requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_GroupName != null)
{
requestLogsConfig_logsConfig_CloudWatchLogs.GroupName = requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_GroupName;
requestLogsConfig_logsConfig_CloudWatchLogsIsNull = false;
}
Amazon.CodeBuild.LogsConfigStatusType requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_Status = null;
if (cmdletContext.CloudWatchLogs_Status != null)
{
requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_Status = cmdletContext.CloudWatchLogs_Status;
}
if (requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_Status != null)
{
requestLogsConfig_logsConfig_CloudWatchLogs.Status = requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_Status;
requestLogsConfig_logsConfig_CloudWatchLogsIsNull = false;
}
System.String requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_StreamName = null;
if (cmdletContext.CloudWatchLogs_StreamName != null)
{
requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_StreamName = cmdletContext.CloudWatchLogs_StreamName;
}
if (requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_StreamName != null)
{
requestLogsConfig_logsConfig_CloudWatchLogs.StreamName = requestLogsConfig_logsConfig_CloudWatchLogs_cloudWatchLogs_StreamName;
requestLogsConfig_logsConfig_CloudWatchLogsIsNull = false;
}
// determine if requestLogsConfig_logsConfig_CloudWatchLogs should be set to null
if (requestLogsConfig_logsConfig_CloudWatchLogsIsNull)
{
requestLogsConfig_logsConfig_CloudWatchLogs = null;
}
if (requestLogsConfig_logsConfig_CloudWatchLogs != null)
{
request.LogsConfig.CloudWatchLogs = requestLogsConfig_logsConfig_CloudWatchLogs;
requestLogsConfigIsNull = false;
}
Amazon.CodeBuild.Model.S3LogsConfig requestLogsConfig_logsConfig_S3Logs = null;
// populate S3Logs
var requestLogsConfig_logsConfig_S3LogsIsNull = true;
requestLogsConfig_logsConfig_S3Logs = new Amazon.CodeBuild.Model.S3LogsConfig();
Amazon.CodeBuild.BucketOwnerAccess requestLogsConfig_logsConfig_S3Logs_s3Logs_BucketOwnerAccess = null;
if (cmdletContext.S3Logs_BucketOwnerAccess != null)
{
requestLogsConfig_logsConfig_S3Logs_s3Logs_BucketOwnerAccess = cmdletContext.S3Logs_BucketOwnerAccess;
}
if (requestLogsConfig_logsConfig_S3Logs_s3Logs_BucketOwnerAccess != null)
{
requestLogsConfig_logsConfig_S3Logs.BucketOwnerAccess = requestLogsConfig_logsConfig_S3Logs_s3Logs_BucketOwnerAccess;
requestLogsConfig_logsConfig_S3LogsIsNull = false;
}
System.Boolean? requestLogsConfig_logsConfig_S3Logs_s3Logs_EncryptionDisabled = null;
if (cmdletContext.S3Logs_EncryptionDisabled != null)
{
requestLogsConfig_logsConfig_S3Logs_s3Logs_EncryptionDisabled = cmdletContext.S3Logs_EncryptionDisabled.Value;
}
if (requestLogsConfig_logsConfig_S3Logs_s3Logs_EncryptionDisabled != null)
{
requestLogsConfig_logsConfig_S3Logs.EncryptionDisabled = requestLogsConfig_logsConfig_S3Logs_s3Logs_EncryptionDisabled.Value;
requestLogsConfig_logsConfig_S3LogsIsNull = false;
}
System.String requestLogsConfig_logsConfig_S3Logs_s3Logs_Location = null;
if (cmdletContext.S3Logs_Location != null)
{
requestLogsConfig_logsConfig_S3Logs_s3Logs_Location = cmdletContext.S3Logs_Location;
}
if (requestLogsConfig_logsConfig_S3Logs_s3Logs_Location != null)
{
requestLogsConfig_logsConfig_S3Logs.Location = requestLogsConfig_logsConfig_S3Logs_s3Logs_Location;
requestLogsConfig_logsConfig_S3LogsIsNull = false;
}
Amazon.CodeBuild.LogsConfigStatusType requestLogsConfig_logsConfig_S3Logs_s3Logs_Status = null;
if (cmdletContext.S3Logs_Status != null)
{
requestLogsConfig_logsConfig_S3Logs_s3Logs_Status = cmdletContext.S3Logs_Status;
}
if (requestLogsConfig_logsConfig_S3Logs_s3Logs_Status != null)
{
requestLogsConfig_logsConfig_S3Logs.Status = requestLogsConfig_logsConfig_S3Logs_s3Logs_Status;
requestLogsConfig_logsConfig_S3LogsIsNull = false;
}
// determine if requestLogsConfig_logsConfig_S3Logs should be set to null
if (requestLogsConfig_logsConfig_S3LogsIsNull)
{
requestLogsConfig_logsConfig_S3Logs = null;
}
if (requestLogsConfig_logsConfig_S3Logs != null)
{
request.LogsConfig.S3Logs = requestLogsConfig_logsConfig_S3Logs;
requestLogsConfigIsNull = false;
}
// determine if request.LogsConfig should be set to null
if (requestLogsConfigIsNull)
{
request.LogsConfig = null;
}
if (cmdletContext.Name != null)
{
request.Name = cmdletContext.Name;
}
if (cmdletContext.QueuedTimeoutInMinute != null)
{
request.QueuedTimeoutInMinutes = cmdletContext.QueuedTimeoutInMinute.Value;
}
if (cmdletContext.SecondaryArtifact != null)
{
request.SecondaryArtifacts = cmdletContext.SecondaryArtifact;
}
if (cmdletContext.SecondarySource != null)
{
request.SecondarySources = cmdletContext.SecondarySource;
}
if (cmdletContext.SecondarySourceVersion != null)
{
request.SecondarySourceVersions = cmdletContext.SecondarySourceVersion;
}
if (cmdletContext.ServiceRole != null)
{
request.ServiceRole = cmdletContext.ServiceRole;
}
// populate Source
var requestSourceIsNull = true;
request.Source = new Amazon.CodeBuild.Model.ProjectSource();
System.String requestSource_source_Buildspec = null;
if (cmdletContext.Source_Buildspec != null)
{
requestSource_source_Buildspec = cmdletContext.Source_Buildspec;
}
if (requestSource_source_Buildspec != null)
{
request.Source.Buildspec = requestSource_source_Buildspec;
requestSourceIsNull = false;
}
System.Int32? requestSource_source_GitCloneDepth = null;
if (cmdletContext.Source_GitCloneDepth != null)
{
requestSource_source_GitCloneDepth = cmdletContext.Source_GitCloneDepth.Value;
}
if (requestSource_source_GitCloneDepth != null)
{
request.Source.GitCloneDepth = requestSource_source_GitCloneDepth.Value;
requestSourceIsNull = false;
}
System.Boolean? requestSource_source_InsecureSsl = null;
if (cmdletContext.Source_InsecureSsl != null)
{
requestSource_source_InsecureSsl = cmdletContext.Source_InsecureSsl.Value;
}
if (requestSource_source_InsecureSsl != null)
{
request.Source.InsecureSsl = requestSource_source_InsecureSsl.Value;
requestSourceIsNull = false;
}
System.String requestSource_source_Location = null;
if (cmdletContext.Source_Location != null)
{
requestSource_source_Location = cmdletContext.Source_Location;
}
if (requestSource_source_Location != null)
{
request.Source.Location = requestSource_source_Location;
requestSourceIsNull = false;
}
System.Boolean? requestSource_source_ReportBuildStatus = null;
if (cmdletContext.Source_ReportBuildStatus != null)
{
requestSource_source_ReportBuildStatus = cmdletContext.Source_ReportBuildStatus.Value;
}
if (requestSource_source_ReportBuildStatus != null)
{
request.Source.ReportBuildStatus = requestSource_source_ReportBuildStatus.Value;
requestSourceIsNull = false;
}
System.String requestSource_source_SourceIdentifier = null;
if (cmdletContext.Source_SourceIdentifier != null)
{
requestSource_source_SourceIdentifier = cmdletContext.Source_SourceIdentifier;
}
if (requestSource_source_SourceIdentifier != null)
{
request.Source.SourceIdentifier = requestSource_source_SourceIdentifier;
requestSourceIsNull = false;
}
Amazon.CodeBuild.SourceType requestSource_source_Type = null;
if (cmdletContext.Source_Type != null)
{
requestSource_source_Type = cmdletContext.Source_Type;
}
if (requestSource_source_Type != null)
{
request.Source.Type = requestSource_source_Type;
requestSourceIsNull = false;
}
Amazon.CodeBuild.Model.GitSubmodulesConfig requestSource_source_GitSubmodulesConfig = null;
// populate GitSubmodulesConfig
var requestSource_source_GitSubmodulesConfigIsNull = true;
requestSource_source_GitSubmodulesConfig = new Amazon.CodeBuild.Model.GitSubmodulesConfig();
System.Boolean? requestSource_source_GitSubmodulesConfig_gitSubmodulesConfig_FetchSubmodule = null;
if (cmdletContext.GitSubmodulesConfig_FetchSubmodule != null)
{
requestSource_source_GitSubmodulesConfig_gitSubmodulesConfig_FetchSubmodule = cmdletContext.GitSubmodulesConfig_FetchSubmodule.Value;
}
if (requestSource_source_GitSubmodulesConfig_gitSubmodulesConfig_FetchSubmodule != null)
{
requestSource_source_GitSubmodulesConfig.FetchSubmodules = requestSource_source_GitSubmodulesConfig_gitSubmodulesConfig_FetchSubmodule.Value;
requestSource_source_GitSubmodulesConfigIsNull = false;
}
// determine if requestSource_source_GitSubmodulesConfig should be set to null
if (requestSource_source_GitSubmodulesConfigIsNull)
{
requestSource_source_GitSubmodulesConfig = null;
}
if (requestSource_source_GitSubmodulesConfig != null)
{
request.Source.GitSubmodulesConfig = requestSource_source_GitSubmodulesConfig;
requestSourceIsNull = false;
}
Amazon.CodeBuild.Model.SourceAuth requestSource_source_Auth = null;
// populate Auth
var requestSource_source_AuthIsNull = true;
requestSource_source_Auth = new Amazon.CodeBuild.Model.SourceAuth();
System.String requestSource_source_Auth_auth_Resource = null;
if (cmdletContext.Auth_Resource != null)
{
requestSource_source_Auth_auth_Resource = cmdletContext.Auth_Resource;
}
if (requestSource_source_Auth_auth_Resource != null)
{
requestSource_source_Auth.Resource = requestSource_source_Auth_auth_Resource;
requestSource_source_AuthIsNull = false;
}
Amazon.CodeBuild.SourceAuthType requestSource_source_Auth_auth_Type = null;
if (cmdletContext.Auth_Type != null)
{
requestSource_source_Auth_auth_Type = cmdletContext.Auth_Type;
}
if (requestSource_source_Auth_auth_Type != null)
{
requestSource_source_Auth.Type = requestSource_source_Auth_auth_Type;
requestSource_source_AuthIsNull = false;
}
// determine if requestSource_source_Auth should be set to null
if (requestSource_source_AuthIsNull)
{
requestSource_source_Auth = null;
}
if (requestSource_source_Auth != null)
{
request.Source.Auth = requestSource_source_Auth;
requestSourceIsNull = false;
}
Amazon.CodeBuild.Model.BuildStatusConfig requestSource_source_BuildStatusConfig = null;
// populate BuildStatusConfig
var requestSource_source_BuildStatusConfigIsNull = true;
requestSource_source_BuildStatusConfig = new Amazon.CodeBuild.Model.BuildStatusConfig();
System.String requestSource_source_BuildStatusConfig_buildStatusConfig_Context = null;
if (cmdletContext.BuildStatusConfig_Context != null)
{
requestSource_source_BuildStatusConfig_buildStatusConfig_Context = cmdletContext.BuildStatusConfig_Context;
}
if (requestSource_source_BuildStatusConfig_buildStatusConfig_Context != null)
{
requestSource_source_BuildStatusConfig.Context = requestSource_source_BuildStatusConfig_buildStatusConfig_Context;
requestSource_source_BuildStatusConfigIsNull = false;
}
System.String requestSource_source_BuildStatusConfig_buildStatusConfig_TargetUrl = null;
if (cmdletContext.BuildStatusConfig_TargetUrl != null)
{
requestSource_source_BuildStatusConfig_buildStatusConfig_TargetUrl = cmdletContext.BuildStatusConfig_TargetUrl;
}
if (requestSource_source_BuildStatusConfig_buildStatusConfig_TargetUrl != null)
{
requestSource_source_BuildStatusConfig.TargetUrl = requestSource_source_BuildStatusConfig_buildStatusConfig_TargetUrl;
requestSource_source_BuildStatusConfigIsNull = false;
}
// determine if requestSource_source_BuildStatusConfig should be set to null
if (requestSource_source_BuildStatusConfigIsNull)
{
requestSource_source_BuildStatusConfig = null;
}
if (requestSource_source_BuildStatusConfig != null)
{
request.Source.BuildStatusConfig = requestSource_source_BuildStatusConfig;
requestSourceIsNull = false;
}
// determine if request.Source should be set to null
if (requestSourceIsNull)
{
request.Source = null;
}
if (cmdletContext.SourceVersion != null)
{
request.SourceVersion = cmdletContext.SourceVersion;
}
if (cmdletContext.Tag != null)
{
request.Tags = cmdletContext.Tag;
}
if (cmdletContext.TimeoutInMinute != null)
{
request.TimeoutInMinutes = cmdletContext.TimeoutInMinute.Value;
}
// populate VpcConfig
var requestVpcConfigIsNull = true;
request.VpcConfig = new Amazon.CodeBuild.Model.VpcConfig();
List requestVpcConfig_vpcConfig_SecurityGroupId = null;
if (cmdletContext.VpcConfig_SecurityGroupId != null)
{
requestVpcConfig_vpcConfig_SecurityGroupId = cmdletContext.VpcConfig_SecurityGroupId;
}
if (requestVpcConfig_vpcConfig_SecurityGroupId != null)
{
request.VpcConfig.SecurityGroupIds = requestVpcConfig_vpcConfig_SecurityGroupId;
requestVpcConfigIsNull = false;
}
List requestVpcConfig_vpcConfig_Subnet = null;
if (cmdletContext.VpcConfig_Subnet != null)
{
requestVpcConfig_vpcConfig_Subnet = cmdletContext.VpcConfig_Subnet;
}
if (requestVpcConfig_vpcConfig_Subnet != null)
{
request.VpcConfig.Subnets = requestVpcConfig_vpcConfig_Subnet;
requestVpcConfigIsNull = false;
}
System.String requestVpcConfig_vpcConfig_VpcId = null;
if (cmdletContext.VpcConfig_VpcId != null)
{
requestVpcConfig_vpcConfig_VpcId = cmdletContext.VpcConfig_VpcId;
}
if (requestVpcConfig_vpcConfig_VpcId != null)
{
request.VpcConfig.VpcId = requestVpcConfig_vpcConfig_VpcId;
requestVpcConfigIsNull = false;
}
// determine if request.VpcConfig should be set to null
if (requestVpcConfigIsNull)
{
request.VpcConfig = null;
}
CmdletOutput output;
// issue call
var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
try
{
var response = CallAWSServiceOperation(client, request);
object pipelineOutput = null;
pipelineOutput = cmdletContext.Select(response, this);
output = new CmdletOutput
{
PipelineOutput = pipelineOutput,
ServiceResponse = response
};
}
catch (Exception e)
{
output = new CmdletOutput { ErrorResponse = e };
}
return output;
}
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
private Amazon.CodeBuild.Model.CreateProjectResponse CallAWSServiceOperation(IAmazonCodeBuild client, Amazon.CodeBuild.Model.CreateProjectRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CodeBuild", "CreateProject");
try
{
#if DESKTOP
return client.CreateProject(request);
#elif CORECLR
return client.CreateProjectAsync(request).GetAwaiter().GetResult();
#else
#error "Unknown build edition"
#endif
}
catch (AmazonServiceException exc)
{
var webException = exc.InnerException as System.Net.WebException;
if (webException != null)
{
throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
}
throw;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public System.String Artifacts_ArtifactIdentifier { get; set; }
public Amazon.CodeBuild.BucketOwnerAccess Artifacts_BucketOwnerAccess { get; set; }
public System.Boolean? Artifacts_EncryptionDisabled { get; set; }
public System.String Artifacts_Location { get; set; }
public System.String Artifacts_Name { get; set; }
public Amazon.CodeBuild.ArtifactNamespace Artifacts_NamespaceType { get; set; }
public System.Boolean? Artifacts_OverrideArtifactName { get; set; }
public Amazon.CodeBuild.ArtifactPackaging Artifacts_Packaging { get; set; }
public System.String Artifacts_Path { get; set; }
public Amazon.CodeBuild.ArtifactsType Artifacts_Type { get; set; }
public System.Boolean? BadgeEnabled { get; set; }
public Amazon.CodeBuild.BatchReportModeType BuildBatchConfig_BatchReportMode { get; set; }
public System.Boolean? BuildBatchConfig_CombineArtifact { get; set; }
public List Restrictions_ComputeTypesAllowed { get; set; }
public System.Int32? Restrictions_MaximumBuildsAllowed { get; set; }
public System.String BuildBatchConfig_ServiceRole { get; set; }
public System.Int32? BuildBatchConfig_TimeoutInMin { get; set; }
public System.String Cache_Location { get; set; }
public List Cache_Mode { get; set; }
public Amazon.CodeBuild.CacheType Cache_Type { get; set; }
public System.Int32? ConcurrentBuildLimit { get; set; }
public System.String Description { get; set; }
public System.String EncryptionKey { get; set; }
public System.String Environment_Certificate { get; set; }
public Amazon.CodeBuild.ComputeType Environment_ComputeType { get; set; }
public List Environment_EnvironmentVariable { get; set; }
public System.String Environment_Image { get; set; }
public Amazon.CodeBuild.ImagePullCredentialsType Environment_ImagePullCredentialsType { get; set; }
public System.Boolean? Environment_PrivilegedMode { get; set; }
public System.String RegistryCredential_Credential { get; set; }
public Amazon.CodeBuild.CredentialProviderType RegistryCredential_CredentialProvider { get; set; }
public Amazon.CodeBuild.EnvironmentType Environment_Type { get; set; }
public List FileSystemLocation { get; set; }
public System.String CloudWatchLogs_GroupName { get; set; }
public Amazon.CodeBuild.LogsConfigStatusType CloudWatchLogs_Status { get; set; }
public System.String CloudWatchLogs_StreamName { get; set; }
public Amazon.CodeBuild.BucketOwnerAccess S3Logs_BucketOwnerAccess { get; set; }
public System.Boolean? S3Logs_EncryptionDisabled { get; set; }
public System.String S3Logs_Location { get; set; }
public Amazon.CodeBuild.LogsConfigStatusType S3Logs_Status { get; set; }
public System.String Name { get; set; }
public System.Int32? QueuedTimeoutInMinute { get; set; }
public List SecondaryArtifact { get; set; }
public List SecondarySource { get; set; }
public List SecondarySourceVersion { get; set; }
public System.String ServiceRole { get; set; }
public System.String Auth_Resource { get; set; }
public Amazon.CodeBuild.SourceAuthType Auth_Type { get; set; }
public System.String Source_Buildspec { get; set; }
public System.String BuildStatusConfig_Context { get; set; }
public System.String BuildStatusConfig_TargetUrl { get; set; }
public System.Int32? Source_GitCloneDepth { get; set; }
public System.Boolean? GitSubmodulesConfig_FetchSubmodule { get; set; }
public System.Boolean? Source_InsecureSsl { get; set; }
public System.String Source_Location { get; set; }
public System.Boolean? Source_ReportBuildStatus { get; set; }
public System.String Source_SourceIdentifier { get; set; }
public Amazon.CodeBuild.SourceType Source_Type { get; set; }
public System.String SourceVersion { get; set; }
public List Tag { get; set; }
public System.Int32? TimeoutInMinute { get; set; }
public List VpcConfig_SecurityGroupId { get; set; }
public List VpcConfig_Subnet { get; set; }
public System.String VpcConfig_VpcId { get; set; }
public System.Func Select { get; set; } =
(response, cmdlet) => response.Project;
}
}
}