/******************************************************************************* * 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.DeviceFarm; using Amazon.DeviceFarm.Model; namespace Amazon.PowerShell.Cmdlets.DF { /// /// Schedules a run. /// [Cmdlet("Submit", "DFTestRun", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("Amazon.DeviceFarm.Model.Run")] [AWSCmdlet("Calls the AWS Device Farm ScheduleRun API operation.", Operation = new[] {"ScheduleRun"}, SelectReturnType = typeof(Amazon.DeviceFarm.Model.ScheduleRunResponse))] [AWSCmdletOutput("Amazon.DeviceFarm.Model.Run or Amazon.DeviceFarm.Model.ScheduleRunResponse", "This cmdlet returns an Amazon.DeviceFarm.Model.Run object.", "The service call response (type Amazon.DeviceFarm.Model.ScheduleRunResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class SubmitDFTestRunCmdlet : AmazonDeviceFarmClientCmdlet, IExecutor { #region Parameter ExecutionConfiguration_AccountsCleanup /// /// /// True if account cleanup is enabled at the beginning of the test. Otherwise, false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ExecutionConfiguration_AccountsCleanup { get; set; } #endregion #region Parameter CustomerArtifactPaths_AndroidPath /// /// /// Comma-separated list of paths on the Android device where the artifacts generated /// by the customer's tests are pulled from. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_CustomerArtifactPaths_AndroidPaths")] public System.String[] CustomerArtifactPaths_AndroidPath { get; set; } #endregion #region Parameter AppArn /// /// /// The ARN of an application package to run tests against, created with CreateUpload. /// See ListUploads. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String AppArn { get; set; } #endregion #region Parameter ExecutionConfiguration_AppPackagesCleanup /// /// /// True if app package cleanup is enabled at the beginning of the test. Otherwise, false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ExecutionConfiguration_AppPackagesCleanup { get; set; } #endregion #region Parameter Configuration_AuxiliaryApp /// /// /// A list of upload ARNs for app packages to be installed with your app. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_AuxiliaryApps")] public System.String[] Configuration_AuxiliaryApp { get; set; } #endregion #region Parameter Configuration_BillingMethod /// /// /// Specifies the billing method for a test run: metered or unmetered. /// If the parameter is not specified, the default value is metered.If you have purchased unmetered device slots, you must set this parameter to unmetered /// to make use of them. Otherwise, your run counts against your metered time. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [AWSConstantClassSource("Amazon.DeviceFarm.BillingMethod")] public Amazon.DeviceFarm.BillingMethod Configuration_BillingMethod { get; set; } #endregion #region Parameter Radios_Bluetooth /// /// /// True if Bluetooth is enabled at the beginning of the test. Otherwise, false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_Radios_Bluetooth")] public System.Boolean? Radios_Bluetooth { get; set; } #endregion #region Parameter CustomerArtifactPaths_DeviceHostPath /// /// /// Comma-separated list of paths in the test execution environment where the artifacts /// generated by the customer's tests are pulled from. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_CustomerArtifactPaths_DeviceHostPaths")] public System.String[] CustomerArtifactPaths_DeviceHostPath { get; set; } #endregion #region Parameter DevicePoolArn /// /// /// The ARN of the device pool for the run to be scheduled. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String DevicePoolArn { get; set; } #endregion #region Parameter Configuration_ExtraDataPackageArn /// /// /// The ARN of the extra data for the run. The extra data is a .zip file that AWS Device /// Farm extracts to external data for Android or the app's sandbox for iOS. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Configuration_ExtraDataPackageArn { get; set; } #endregion #region Parameter Test_Filter /// /// /// The test's filter. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Test_Filter { get; set; } #endregion #region Parameter DeviceSelectionConfiguration_Filter /// /// /// Amazon.DeviceFarm.Model.DeviceSelectionConfiguration.Filters /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("DeviceSelectionConfiguration_Filters")] public Amazon.DeviceFarm.Model.DeviceFilter[] DeviceSelectionConfiguration_Filter { get; set; } #endregion #region Parameter Radios_Gp /// /// /// True if GPS is enabled at the beginning of the test. Otherwise, false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_Radios_Gps")] public System.Boolean? Radios_Gp { get; set; } #endregion #region Parameter CustomerArtifactPaths_IosPath /// /// /// Comma-separated list of paths on the iOS device where the artifacts generated by the /// customer's tests are pulled from. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_CustomerArtifactPaths_IosPaths")] public System.String[] CustomerArtifactPaths_IosPath { get; set; } #endregion #region Parameter ExecutionConfiguration_JobTimeoutMinute /// /// /// The number of minutes a test run executes before it times out. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ExecutionConfiguration_JobTimeoutMinutes")] public System.Int32? ExecutionConfiguration_JobTimeoutMinute { get; set; } #endregion #region Parameter Location_Latitude /// /// /// The latitude. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_Location_Latitude")] public System.Double? Location_Latitude { get; set; } #endregion #region Parameter Configuration_Locale /// /// /// Information about the locale that is used for the run. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Configuration_Locale { get; set; } #endregion #region Parameter Location_Longitude /// /// /// The longitude. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_Location_Longitude")] public System.Double? Location_Longitude { get; set; } #endregion #region Parameter DeviceSelectionConfiguration_MaxDevice /// /// /// The maximum number of devices to be included in a test run. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("DeviceSelectionConfiguration_MaxDevices")] public System.Int32? DeviceSelectionConfiguration_MaxDevice { get; set; } #endregion #region Parameter Name /// /// /// The name for the run to be scheduled. /// /// [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)] public System.String Name { get; set; } #endregion #region Parameter Configuration_NetworkProfileArn /// /// /// Reserved for internal use. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Configuration_NetworkProfileArn { get; set; } #endregion #region Parameter Radios_Nfc /// /// /// True if NFC is enabled at the beginning of the test. Otherwise, false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_Radios_Nfc")] public System.Boolean? Radios_Nfc { get; set; } #endregion #region Parameter Test_Parameter /// /// /// The test's parameters, such as test framework parameters and fixture settings. Parameters /// are represented by name-value pairs of strings.For all tests:For Calabash tests:For Appium tests (all types):For fuzz tests (Android only):For Explorer tests:For Instrumentation:For XCTest and XCTestUI:For UIAutomator: /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Test_Parameters")] public System.Collections.Hashtable Test_Parameter { get; set; } #endregion #region Parameter ProjectArn /// /// /// The ARN of the project for the run to be scheduled. /// /// #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 ProjectArn { get; set; } #endregion #region Parameter ExecutionConfiguration_SkipAppResign /// /// /// When set to true, for private devices, Device Farm does not sign your /// app again. For public devices, Device Farm always signs your apps again.For more information about how Device Farm re-signs your apps, see Do /// you modify my app? in the AWS Device Farm FAQs. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ExecutionConfiguration_SkipAppResign { get; set; } #endregion #region Parameter Test_TestPackageArn /// /// /// The ARN of the uploaded test to be run. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Test_TestPackageArn { get; set; } #endregion #region Parameter Test_TestSpecArn /// /// /// The ARN of the YAML-formatted test specification. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Test_TestSpecArn { get; set; } #endregion #region Parameter Test_Type /// /// /// The test's type.Must be one of the following values: /// /// #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.DeviceFarm.TestType")] public Amazon.DeviceFarm.TestType Test_Type { get; set; } #endregion #region Parameter ExecutionConfiguration_VideoCapture /// /// /// Set to true to enable video capture. Otherwise, set to false. The default is true. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ExecutionConfiguration_VideoCapture { get; set; } #endregion #region Parameter Configuration_VpceConfigurationArn /// /// /// An array of ARNs for your VPC endpoint configurations. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_VpceConfigurationArns")] public System.String[] Configuration_VpceConfigurationArn { get; set; } #endregion #region Parameter Radios_Wifi /// /// /// True if Wi-Fi is enabled at the beginning of the test. Otherwise, false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Configuration_Radios_Wifi")] public System.Boolean? Radios_Wifi { get; set; } #endregion #region Parameter Select /// /// Use the -Select parameter to control the cmdlet output. The default value is 'Run'. /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.DeviceFarm.Model.ScheduleRunResponse). /// Specifying the name of a property of type Amazon.DeviceFarm.Model.ScheduleRunResponse 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; } = "Run"; #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, "Submit-DFTestRun (ScheduleRun)")) { 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.AppArn = this.AppArn; if (this.Configuration_AuxiliaryApp != null) { context.Configuration_AuxiliaryApp = new List(this.Configuration_AuxiliaryApp); } context.Configuration_BillingMethod = this.Configuration_BillingMethod; if (this.CustomerArtifactPaths_AndroidPath != null) { context.CustomerArtifactPaths_AndroidPath = new List(this.CustomerArtifactPaths_AndroidPath); } if (this.CustomerArtifactPaths_DeviceHostPath != null) { context.CustomerArtifactPaths_DeviceHostPath = new List(this.CustomerArtifactPaths_DeviceHostPath); } if (this.CustomerArtifactPaths_IosPath != null) { context.CustomerArtifactPaths_IosPath = new List(this.CustomerArtifactPaths_IosPath); } context.Configuration_ExtraDataPackageArn = this.Configuration_ExtraDataPackageArn; context.Configuration_Locale = this.Configuration_Locale; context.Location_Latitude = this.Location_Latitude; context.Location_Longitude = this.Location_Longitude; context.Configuration_NetworkProfileArn = this.Configuration_NetworkProfileArn; context.Radios_Bluetooth = this.Radios_Bluetooth; context.Radios_Gp = this.Radios_Gp; context.Radios_Nfc = this.Radios_Nfc; context.Radios_Wifi = this.Radios_Wifi; if (this.Configuration_VpceConfigurationArn != null) { context.Configuration_VpceConfigurationArn = new List(this.Configuration_VpceConfigurationArn); } context.DevicePoolArn = this.DevicePoolArn; if (this.DeviceSelectionConfiguration_Filter != null) { context.DeviceSelectionConfiguration_Filter = new List(this.DeviceSelectionConfiguration_Filter); } context.DeviceSelectionConfiguration_MaxDevice = this.DeviceSelectionConfiguration_MaxDevice; context.ExecutionConfiguration_AccountsCleanup = this.ExecutionConfiguration_AccountsCleanup; context.ExecutionConfiguration_AppPackagesCleanup = this.ExecutionConfiguration_AppPackagesCleanup; context.ExecutionConfiguration_JobTimeoutMinute = this.ExecutionConfiguration_JobTimeoutMinute; context.ExecutionConfiguration_SkipAppResign = this.ExecutionConfiguration_SkipAppResign; context.ExecutionConfiguration_VideoCapture = this.ExecutionConfiguration_VideoCapture; context.Name = this.Name; context.ProjectArn = this.ProjectArn; #if MODULAR if (this.ProjectArn == null && ParameterWasBound(nameof(this.ProjectArn))) { WriteWarning("You are passing $null as a value for parameter ProjectArn 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.Test_Filter = this.Test_Filter; if (this.Test_Parameter != null) { context.Test_Parameter = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.Test_Parameter.Keys) { context.Test_Parameter.Add((String)hashKey, (String)(this.Test_Parameter[hashKey])); } } context.Test_TestPackageArn = this.Test_TestPackageArn; context.Test_TestSpecArn = this.Test_TestSpecArn; context.Test_Type = this.Test_Type; #if MODULAR if (this.Test_Type == null && ParameterWasBound(nameof(this.Test_Type))) { WriteWarning("You are passing $null as a value for parameter Test_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 // 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.DeviceFarm.Model.ScheduleRunRequest(); if (cmdletContext.AppArn != null) { request.AppArn = cmdletContext.AppArn; } // populate Configuration var requestConfigurationIsNull = true; request.Configuration = new Amazon.DeviceFarm.Model.ScheduleRunConfiguration(); List requestConfiguration_configuration_AuxiliaryApp = null; if (cmdletContext.Configuration_AuxiliaryApp != null) { requestConfiguration_configuration_AuxiliaryApp = cmdletContext.Configuration_AuxiliaryApp; } if (requestConfiguration_configuration_AuxiliaryApp != null) { request.Configuration.AuxiliaryApps = requestConfiguration_configuration_AuxiliaryApp; requestConfigurationIsNull = false; } Amazon.DeviceFarm.BillingMethod requestConfiguration_configuration_BillingMethod = null; if (cmdletContext.Configuration_BillingMethod != null) { requestConfiguration_configuration_BillingMethod = cmdletContext.Configuration_BillingMethod; } if (requestConfiguration_configuration_BillingMethod != null) { request.Configuration.BillingMethod = requestConfiguration_configuration_BillingMethod; requestConfigurationIsNull = false; } System.String requestConfiguration_configuration_ExtraDataPackageArn = null; if (cmdletContext.Configuration_ExtraDataPackageArn != null) { requestConfiguration_configuration_ExtraDataPackageArn = cmdletContext.Configuration_ExtraDataPackageArn; } if (requestConfiguration_configuration_ExtraDataPackageArn != null) { request.Configuration.ExtraDataPackageArn = requestConfiguration_configuration_ExtraDataPackageArn; requestConfigurationIsNull = false; } System.String requestConfiguration_configuration_Locale = null; if (cmdletContext.Configuration_Locale != null) { requestConfiguration_configuration_Locale = cmdletContext.Configuration_Locale; } if (requestConfiguration_configuration_Locale != null) { request.Configuration.Locale = requestConfiguration_configuration_Locale; requestConfigurationIsNull = false; } System.String requestConfiguration_configuration_NetworkProfileArn = null; if (cmdletContext.Configuration_NetworkProfileArn != null) { requestConfiguration_configuration_NetworkProfileArn = cmdletContext.Configuration_NetworkProfileArn; } if (requestConfiguration_configuration_NetworkProfileArn != null) { request.Configuration.NetworkProfileArn = requestConfiguration_configuration_NetworkProfileArn; requestConfigurationIsNull = false; } List requestConfiguration_configuration_VpceConfigurationArn = null; if (cmdletContext.Configuration_VpceConfigurationArn != null) { requestConfiguration_configuration_VpceConfigurationArn = cmdletContext.Configuration_VpceConfigurationArn; } if (requestConfiguration_configuration_VpceConfigurationArn != null) { request.Configuration.VpceConfigurationArns = requestConfiguration_configuration_VpceConfigurationArn; requestConfigurationIsNull = false; } Amazon.DeviceFarm.Model.Location requestConfiguration_configuration_Location = null; // populate Location var requestConfiguration_configuration_LocationIsNull = true; requestConfiguration_configuration_Location = new Amazon.DeviceFarm.Model.Location(); System.Double? requestConfiguration_configuration_Location_location_Latitude = null; if (cmdletContext.Location_Latitude != null) { requestConfiguration_configuration_Location_location_Latitude = cmdletContext.Location_Latitude.Value; } if (requestConfiguration_configuration_Location_location_Latitude != null) { requestConfiguration_configuration_Location.Latitude = requestConfiguration_configuration_Location_location_Latitude.Value; requestConfiguration_configuration_LocationIsNull = false; } System.Double? requestConfiguration_configuration_Location_location_Longitude = null; if (cmdletContext.Location_Longitude != null) { requestConfiguration_configuration_Location_location_Longitude = cmdletContext.Location_Longitude.Value; } if (requestConfiguration_configuration_Location_location_Longitude != null) { requestConfiguration_configuration_Location.Longitude = requestConfiguration_configuration_Location_location_Longitude.Value; requestConfiguration_configuration_LocationIsNull = false; } // determine if requestConfiguration_configuration_Location should be set to null if (requestConfiguration_configuration_LocationIsNull) { requestConfiguration_configuration_Location = null; } if (requestConfiguration_configuration_Location != null) { request.Configuration.Location = requestConfiguration_configuration_Location; requestConfigurationIsNull = false; } Amazon.DeviceFarm.Model.CustomerArtifactPaths requestConfiguration_configuration_CustomerArtifactPaths = null; // populate CustomerArtifactPaths var requestConfiguration_configuration_CustomerArtifactPathsIsNull = true; requestConfiguration_configuration_CustomerArtifactPaths = new Amazon.DeviceFarm.Model.CustomerArtifactPaths(); List requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_AndroidPath = null; if (cmdletContext.CustomerArtifactPaths_AndroidPath != null) { requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_AndroidPath = cmdletContext.CustomerArtifactPaths_AndroidPath; } if (requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_AndroidPath != null) { requestConfiguration_configuration_CustomerArtifactPaths.AndroidPaths = requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_AndroidPath; requestConfiguration_configuration_CustomerArtifactPathsIsNull = false; } List requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_DeviceHostPath = null; if (cmdletContext.CustomerArtifactPaths_DeviceHostPath != null) { requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_DeviceHostPath = cmdletContext.CustomerArtifactPaths_DeviceHostPath; } if (requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_DeviceHostPath != null) { requestConfiguration_configuration_CustomerArtifactPaths.DeviceHostPaths = requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_DeviceHostPath; requestConfiguration_configuration_CustomerArtifactPathsIsNull = false; } List requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_IosPath = null; if (cmdletContext.CustomerArtifactPaths_IosPath != null) { requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_IosPath = cmdletContext.CustomerArtifactPaths_IosPath; } if (requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_IosPath != null) { requestConfiguration_configuration_CustomerArtifactPaths.IosPaths = requestConfiguration_configuration_CustomerArtifactPaths_customerArtifactPaths_IosPath; requestConfiguration_configuration_CustomerArtifactPathsIsNull = false; } // determine if requestConfiguration_configuration_CustomerArtifactPaths should be set to null if (requestConfiguration_configuration_CustomerArtifactPathsIsNull) { requestConfiguration_configuration_CustomerArtifactPaths = null; } if (requestConfiguration_configuration_CustomerArtifactPaths != null) { request.Configuration.CustomerArtifactPaths = requestConfiguration_configuration_CustomerArtifactPaths; requestConfigurationIsNull = false; } Amazon.DeviceFarm.Model.Radios requestConfiguration_configuration_Radios = null; // populate Radios var requestConfiguration_configuration_RadiosIsNull = true; requestConfiguration_configuration_Radios = new Amazon.DeviceFarm.Model.Radios(); System.Boolean? requestConfiguration_configuration_Radios_radios_Bluetooth = null; if (cmdletContext.Radios_Bluetooth != null) { requestConfiguration_configuration_Radios_radios_Bluetooth = cmdletContext.Radios_Bluetooth.Value; } if (requestConfiguration_configuration_Radios_radios_Bluetooth != null) { requestConfiguration_configuration_Radios.Bluetooth = requestConfiguration_configuration_Radios_radios_Bluetooth.Value; requestConfiguration_configuration_RadiosIsNull = false; } System.Boolean? requestConfiguration_configuration_Radios_radios_Gp = null; if (cmdletContext.Radios_Gp != null) { requestConfiguration_configuration_Radios_radios_Gp = cmdletContext.Radios_Gp.Value; } if (requestConfiguration_configuration_Radios_radios_Gp != null) { requestConfiguration_configuration_Radios.Gps = requestConfiguration_configuration_Radios_radios_Gp.Value; requestConfiguration_configuration_RadiosIsNull = false; } System.Boolean? requestConfiguration_configuration_Radios_radios_Nfc = null; if (cmdletContext.Radios_Nfc != null) { requestConfiguration_configuration_Radios_radios_Nfc = cmdletContext.Radios_Nfc.Value; } if (requestConfiguration_configuration_Radios_radios_Nfc != null) { requestConfiguration_configuration_Radios.Nfc = requestConfiguration_configuration_Radios_radios_Nfc.Value; requestConfiguration_configuration_RadiosIsNull = false; } System.Boolean? requestConfiguration_configuration_Radios_radios_Wifi = null; if (cmdletContext.Radios_Wifi != null) { requestConfiguration_configuration_Radios_radios_Wifi = cmdletContext.Radios_Wifi.Value; } if (requestConfiguration_configuration_Radios_radios_Wifi != null) { requestConfiguration_configuration_Radios.Wifi = requestConfiguration_configuration_Radios_radios_Wifi.Value; requestConfiguration_configuration_RadiosIsNull = false; } // determine if requestConfiguration_configuration_Radios should be set to null if (requestConfiguration_configuration_RadiosIsNull) { requestConfiguration_configuration_Radios = null; } if (requestConfiguration_configuration_Radios != null) { request.Configuration.Radios = requestConfiguration_configuration_Radios; requestConfigurationIsNull = false; } // determine if request.Configuration should be set to null if (requestConfigurationIsNull) { request.Configuration = null; } if (cmdletContext.DevicePoolArn != null) { request.DevicePoolArn = cmdletContext.DevicePoolArn; } // populate DeviceSelectionConfiguration var requestDeviceSelectionConfigurationIsNull = true; request.DeviceSelectionConfiguration = new Amazon.DeviceFarm.Model.DeviceSelectionConfiguration(); List requestDeviceSelectionConfiguration_deviceSelectionConfiguration_Filter = null; if (cmdletContext.DeviceSelectionConfiguration_Filter != null) { requestDeviceSelectionConfiguration_deviceSelectionConfiguration_Filter = cmdletContext.DeviceSelectionConfiguration_Filter; } if (requestDeviceSelectionConfiguration_deviceSelectionConfiguration_Filter != null) { request.DeviceSelectionConfiguration.Filters = requestDeviceSelectionConfiguration_deviceSelectionConfiguration_Filter; requestDeviceSelectionConfigurationIsNull = false; } System.Int32? requestDeviceSelectionConfiguration_deviceSelectionConfiguration_MaxDevice = null; if (cmdletContext.DeviceSelectionConfiguration_MaxDevice != null) { requestDeviceSelectionConfiguration_deviceSelectionConfiguration_MaxDevice = cmdletContext.DeviceSelectionConfiguration_MaxDevice.Value; } if (requestDeviceSelectionConfiguration_deviceSelectionConfiguration_MaxDevice != null) { request.DeviceSelectionConfiguration.MaxDevices = requestDeviceSelectionConfiguration_deviceSelectionConfiguration_MaxDevice.Value; requestDeviceSelectionConfigurationIsNull = false; } // determine if request.DeviceSelectionConfiguration should be set to null if (requestDeviceSelectionConfigurationIsNull) { request.DeviceSelectionConfiguration = null; } // populate ExecutionConfiguration var requestExecutionConfigurationIsNull = true; request.ExecutionConfiguration = new Amazon.DeviceFarm.Model.ExecutionConfiguration(); System.Boolean? requestExecutionConfiguration_executionConfiguration_AccountsCleanup = null; if (cmdletContext.ExecutionConfiguration_AccountsCleanup != null) { requestExecutionConfiguration_executionConfiguration_AccountsCleanup = cmdletContext.ExecutionConfiguration_AccountsCleanup.Value; } if (requestExecutionConfiguration_executionConfiguration_AccountsCleanup != null) { request.ExecutionConfiguration.AccountsCleanup = requestExecutionConfiguration_executionConfiguration_AccountsCleanup.Value; requestExecutionConfigurationIsNull = false; } System.Boolean? requestExecutionConfiguration_executionConfiguration_AppPackagesCleanup = null; if (cmdletContext.ExecutionConfiguration_AppPackagesCleanup != null) { requestExecutionConfiguration_executionConfiguration_AppPackagesCleanup = cmdletContext.ExecutionConfiguration_AppPackagesCleanup.Value; } if (requestExecutionConfiguration_executionConfiguration_AppPackagesCleanup != null) { request.ExecutionConfiguration.AppPackagesCleanup = requestExecutionConfiguration_executionConfiguration_AppPackagesCleanup.Value; requestExecutionConfigurationIsNull = false; } System.Int32? requestExecutionConfiguration_executionConfiguration_JobTimeoutMinute = null; if (cmdletContext.ExecutionConfiguration_JobTimeoutMinute != null) { requestExecutionConfiguration_executionConfiguration_JobTimeoutMinute = cmdletContext.ExecutionConfiguration_JobTimeoutMinute.Value; } if (requestExecutionConfiguration_executionConfiguration_JobTimeoutMinute != null) { request.ExecutionConfiguration.JobTimeoutMinutes = requestExecutionConfiguration_executionConfiguration_JobTimeoutMinute.Value; requestExecutionConfigurationIsNull = false; } System.Boolean? requestExecutionConfiguration_executionConfiguration_SkipAppResign = null; if (cmdletContext.ExecutionConfiguration_SkipAppResign != null) { requestExecutionConfiguration_executionConfiguration_SkipAppResign = cmdletContext.ExecutionConfiguration_SkipAppResign.Value; } if (requestExecutionConfiguration_executionConfiguration_SkipAppResign != null) { request.ExecutionConfiguration.SkipAppResign = requestExecutionConfiguration_executionConfiguration_SkipAppResign.Value; requestExecutionConfigurationIsNull = false; } System.Boolean? requestExecutionConfiguration_executionConfiguration_VideoCapture = null; if (cmdletContext.ExecutionConfiguration_VideoCapture != null) { requestExecutionConfiguration_executionConfiguration_VideoCapture = cmdletContext.ExecutionConfiguration_VideoCapture.Value; } if (requestExecutionConfiguration_executionConfiguration_VideoCapture != null) { request.ExecutionConfiguration.VideoCapture = requestExecutionConfiguration_executionConfiguration_VideoCapture.Value; requestExecutionConfigurationIsNull = false; } // determine if request.ExecutionConfiguration should be set to null if (requestExecutionConfigurationIsNull) { request.ExecutionConfiguration = null; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.ProjectArn != null) { request.ProjectArn = cmdletContext.ProjectArn; } // populate Test var requestTestIsNull = true; request.Test = new Amazon.DeviceFarm.Model.ScheduleRunTest(); System.String requestTest_test_Filter = null; if (cmdletContext.Test_Filter != null) { requestTest_test_Filter = cmdletContext.Test_Filter; } if (requestTest_test_Filter != null) { request.Test.Filter = requestTest_test_Filter; requestTestIsNull = false; } Dictionary requestTest_test_Parameter = null; if (cmdletContext.Test_Parameter != null) { requestTest_test_Parameter = cmdletContext.Test_Parameter; } if (requestTest_test_Parameter != null) { request.Test.Parameters = requestTest_test_Parameter; requestTestIsNull = false; } System.String requestTest_test_TestPackageArn = null; if (cmdletContext.Test_TestPackageArn != null) { requestTest_test_TestPackageArn = cmdletContext.Test_TestPackageArn; } if (requestTest_test_TestPackageArn != null) { request.Test.TestPackageArn = requestTest_test_TestPackageArn; requestTestIsNull = false; } System.String requestTest_test_TestSpecArn = null; if (cmdletContext.Test_TestSpecArn != null) { requestTest_test_TestSpecArn = cmdletContext.Test_TestSpecArn; } if (requestTest_test_TestSpecArn != null) { request.Test.TestSpecArn = requestTest_test_TestSpecArn; requestTestIsNull = false; } Amazon.DeviceFarm.TestType requestTest_test_Type = null; if (cmdletContext.Test_Type != null) { requestTest_test_Type = cmdletContext.Test_Type; } if (requestTest_test_Type != null) { request.Test.Type = requestTest_test_Type; requestTestIsNull = false; } // determine if request.Test should be set to null if (requestTestIsNull) { request.Test = 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.DeviceFarm.Model.ScheduleRunResponse CallAWSServiceOperation(IAmazonDeviceFarm client, Amazon.DeviceFarm.Model.ScheduleRunRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Device Farm", "ScheduleRun"); try { #if DESKTOP return client.ScheduleRun(request); #elif CORECLR return client.ScheduleRunAsync(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 AppArn { get; set; } public List Configuration_AuxiliaryApp { get; set; } public Amazon.DeviceFarm.BillingMethod Configuration_BillingMethod { get; set; } public List CustomerArtifactPaths_AndroidPath { get; set; } public List CustomerArtifactPaths_DeviceHostPath { get; set; } public List CustomerArtifactPaths_IosPath { get; set; } public System.String Configuration_ExtraDataPackageArn { get; set; } public System.String Configuration_Locale { get; set; } public System.Double? Location_Latitude { get; set; } public System.Double? Location_Longitude { get; set; } public System.String Configuration_NetworkProfileArn { get; set; } public System.Boolean? Radios_Bluetooth { get; set; } public System.Boolean? Radios_Gp { get; set; } public System.Boolean? Radios_Nfc { get; set; } public System.Boolean? Radios_Wifi { get; set; } public List Configuration_VpceConfigurationArn { get; set; } public System.String DevicePoolArn { get; set; } public List DeviceSelectionConfiguration_Filter { get; set; } public System.Int32? DeviceSelectionConfiguration_MaxDevice { get; set; } public System.Boolean? ExecutionConfiguration_AccountsCleanup { get; set; } public System.Boolean? ExecutionConfiguration_AppPackagesCleanup { get; set; } public System.Int32? ExecutionConfiguration_JobTimeoutMinute { get; set; } public System.Boolean? ExecutionConfiguration_SkipAppResign { get; set; } public System.Boolean? ExecutionConfiguration_VideoCapture { get; set; } public System.String Name { get; set; } public System.String ProjectArn { get; set; } public System.String Test_Filter { get; set; } public Dictionary Test_Parameter { get; set; } public System.String Test_TestPackageArn { get; set; } public System.String Test_TestSpecArn { get; set; } public Amazon.DeviceFarm.TestType Test_Type { get; set; } public System.Func Select { get; set; } = (response, cmdlet) => response.Run; } } }