internal DeploymentRequestFactory()

in Editor/CoreAPI/DeploymentRequestFactory.cs [15:71]


        internal DeploymentRequestFactory(CoreApi coreApi) =>
            GameLiftCoreApi = coreApi ?? throw new ArgumentNullException(nameof(coreApi));

        /// <exception cref="ArgumentNullException">For all parameters.</exception>
        internal virtual (DeploymentRequest request, bool success, Response failedResponse) CreateRequest(
            string scenarioFolderPath, string gameName, bool isDevelopmentBuild)
        {
            if (scenarioFolderPath is null)
            {
                throw new ArgumentNullException(nameof(scenarioFolderPath));
            }

            if (gameName is null)
            {
                throw new ArgumentNullException(nameof(gameName));
            }

            string stackName = GameLiftCoreApi.GetStackName(gameName);
            string cfnTemplatePath = Path.Combine(scenarioFolderPath, Paths.CfnTemplateFileName);
            string parametersPath = Path.Combine(scenarioFolderPath, Paths.ParametersFileName);
            string lambdaFolderPath = Path.Combine(scenarioFolderPath, Paths.LambdaFolderPathInScenario);

            GetSettingResponse currentProfileResponse = GameLiftCoreApi.GetSetting(SettingsKeys.CurrentProfileName);

            if (!currentProfileResponse.Success)
            {
                return (null, false, currentProfileResponse);
            }

            GetSettingResponse currentRegionResponse = GameLiftCoreApi.GetSetting(SettingsKeys.CurrentRegion);

            if (!currentRegionResponse.Success)
            {
                return (null, false, currentRegionResponse);
            }

            GetSettingResponse bucketResponse = GameLiftCoreApi.GetSetting(SettingsKeys.CurrentBucketName);

            if (!bucketResponse.Success)
            {
                return (null, false, bucketResponse);
            }

            var request = new DeploymentRequest()
            {
                Profile = currentProfileResponse.Value,
                Region = currentRegionResponse.Value,
                BucketName = bucketResponse.Value,
                StackName = stackName,
                CfnTemplatePath = cfnTemplatePath,
                ParametersPath = parametersPath,
                IsDevelopmentBuild = isDevelopmentBuild,
                GameName = gameName,
                LambdaFolderPath = lambdaFolderPath,
            };
            return (request, true, null);
        }