public toApigatewayAppCreationRequest()

in src/utils/adapter/adapter.ts [84:110]


    public toApigatewayAppCreationRequest(appToCreate: sdkTypes.AppCreationRequest): adapterTypes.ApigatewayAppCreationRequest {
        if (
            appToCreate.os !== 'iOS' &&
            appToCreate.os !== 'Android' &&
            appToCreate.os !== 'Windows' &&
            appToCreate.os !== 'Linux'
        ) {
            throw this.getCodePushError(`The app OS "${appToCreate.os}" isn't valid. It should be "iOS", "Android", "Windows" or "Linux".`, RequestManager.ERROR_CONFLICT);
        }

        if (
            appToCreate.platform !== 'React-Native' &&
            appToCreate.platform !== 'Cordova' &&
            appToCreate.platform !== 'Electron'
        ) {
            throw this.getCodePushError(`The app platform "${appToCreate.platform}" isn't valid. It should be "React-Native", "Cordova" or "Electron".`, RequestManager.ERROR_CONFLICT);
        }

        const org: string = this.getOrgFromLegacyAppRequest(appToCreate);
        const appcenterClientApp: adapterTypes.App = this.toAppcenterClientApp(appToCreate);

        if (!this.isValidAppCenterAppName(appcenterClientApp.display_name)) {
            throw this.getCodePushError(`The app name "${appcenterClientApp.display_name}" isn't valid. It can only contain alphanumeric characters, dashes, periods, or underscores.`, RequestManager.ERROR_CONFLICT);
        }

        return { org, appcenterClientApp };
    }