Constants used for properties of type BillingMethod.
Inheritance: ConstantClass
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DeviceFarm.Model.GetDevicePoolCompatibilityRequest();

            if (cmdletContext.AppArn != null)
            {
                request.AppArn = cmdletContext.AppArn;
            }

            // populate Configuration
            var requestConfigurationIsNull = true;

            request.Configuration = new Amazon.DeviceFarm.Model.ScheduleRunConfiguration();
            List <System.String> 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 <System.String> 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 <System.String> 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 <System.String> 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 <System.String> 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 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 <System.String, System.String> 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;
            }
            if (cmdletContext.TestType != null)
            {
                request.TestType = cmdletContext.TestType;
            }

            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);
        }
Esempio n. 2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DeviceFarm.Model.CreateRemoteAccessSessionRequest();

            if (cmdletContext.ClientId != null)
            {
                request.ClientId = cmdletContext.ClientId;
            }

            // populate Configuration
            var requestConfigurationIsNull = true;

            request.Configuration = new Amazon.DeviceFarm.Model.CreateRemoteAccessSessionConfiguration();
            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;
            }
            List <System.String> 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;
            }
            // determine if request.Configuration should be set to null
            if (requestConfigurationIsNull)
            {
                request.Configuration = null;
            }
            if (cmdletContext.DeviceArn != null)
            {
                request.DeviceArn = cmdletContext.DeviceArn;
            }
            if (cmdletContext.InstanceArn != null)
            {
                request.InstanceArn = cmdletContext.InstanceArn;
            }
            if (cmdletContext.InteractionMode != null)
            {
                request.InteractionMode = cmdletContext.InteractionMode;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.ProjectArn != null)
            {
                request.ProjectArn = cmdletContext.ProjectArn;
            }
            if (cmdletContext.RemoteDebugEnabled != null)
            {
                request.RemoteDebugEnabled = cmdletContext.RemoteDebugEnabled.Value;
            }
            if (cmdletContext.RemoteRecordAppArn != null)
            {
                request.RemoteRecordAppArn = cmdletContext.RemoteRecordAppArn;
            }
            if (cmdletContext.RemoteRecordEnabled != null)
            {
                request.RemoteRecordEnabled = cmdletContext.RemoteRecordEnabled.Value;
            }
            if (cmdletContext.SkipAppResign != null)
            {
                request.SkipAppResign = cmdletContext.SkipAppResign.Value;
            }
            if (cmdletContext.SshPublicKey != null)
            {
                request.SshPublicKey = cmdletContext.SshPublicKey;
            }

            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);
        }