Controller/Adminhtml/FastlyCdn/Configuration/IsAlreadyConfigured.php
public function execute()
    {
        $result = $this->resultJsonFactory->create();
        try {
            $serviceId = $this->config->getServiceId();
            $apiKey = $this->config->getApiKey();

            if ($serviceId == null && $apiKey == null) {
                return $result->setData([
                    'status'    => true,
                    'flag'      => false
                ]);
            }

            return $result->setData([
                'status'    => true,
                'flag'      => true
            ]);
        } catch (\Exception $e) {
            return $result->setData([
                'status'    => false,
                'msg'       => $e->getMessage()
            ]);
        }
    }
public function execute()
    {
        $result = $this->resultJsonFactory->create();
        try {
            $serviceId = $this->config->getServiceId();
            $apiKey = $this->config->getApiKey();

            if ($serviceId == null && $apiKey == null) {
                return $result->setData([
                    'status'    => true,
                    'flag'      => false
                ]);
            }

            return $result->setData([
                'status'    => true,
                'flag'      => true
            ]);
        } catch (\Exception $e) {
            return $result->setData([
                'status'    => false,
                'msg'       => $e->getMessage()
            ]);
        }
    }
public function execute ( ) { $ result = $ this -> resultJsonFactory -> create ( ) ; try { $ serviceId = $ this -> config -> getServiceId ( ) ; $ apiKey = $ this -> config -> getApiKey ( ) ; if ( $ serviceId == null && $ apiKey == null ) { return $ result -> setData ( [ 'status' => true , 'flag' => false ] ) ; } return $ result -> setData ( [ 'status' => true , 'flag' => true ] ) ; } catch ( \ Exception $ e ) { return $ result -> setData ( [ 'status' => false , 'msg' => $ e -> getMessage ( ) ] ) ; } }
Check if the Fastly service is already configured

@return $this|ResponseInterface|ResultInterface
Check if the Fastly service is already configured