Get migrate check for conflicts.
Get migrate check for conflicts
@return ApiResponse&lt;GetSubResponse&gt;
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
430801
public ApiResponse<GetSubResponse> checkMigrateConflictsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = checkMigrateConflictsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<GetSubResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1325528
public ApiResponse<DynconfigGetConfigResponse> dynconfigGetConfigWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = dynconfigGetConfigValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<DynconfigGetConfigResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1292742
public ApiResponse<PostValidateImportResponse> postValidateImportWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = postValidateImportValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<PostValidateImportResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1217308
private function findIssues(ApiInterface $api, $type)
    {
        /* @var Issues|MergeRequests $api */
        $issues = $api->all($this->getName(), 1, 9999);

        $newIssues = [];

        foreach ((array) $issues as $issue) {
            if ('closed' === $issue['state']) {
                continue;
            }
            $newIssues[] = new GitlabIssue($issue, $type, $this->getUrl());
        }

        return $newIssues;
    }
1115843
public function getChanges()
    {
        $response = $this->client->request('GET', "/{$this->name}/_changes");

        if (200 !== $response->getStatusCode()) {
            throw new Exception('Request wasn\'t successfull');
        }

        return JSONEncoder::decode((string) $response->getBody());
    }
484339
@GET
    @Path("{dbName}/{revision}")
    public Response info(@PathParam("dbName") String dbName, @PathParam("revision") String revision) {
        Flyway flyway = locator.getService(Flyway.class, dbName);
        if (flyway == null)
            throw new NotFoundException();
        Object entity = null;
        switch (revision) {
            case "current":
                entity = flyway.info().current();
                break;
            case "pending":
                entity = flyway.info().pending();
                break;
            case "applied":
                entity = flyway.info().applied();
                break;
            case "first": {
                MigrationInfo[] migrationInfos = flyway.info().all();
                if (migrationInfos.length == 0)
                    throw new NotFoundException();
                entity = migrationInfos[0];
                break;
            }
            case "resolved":
                entity = resolved(flyway.info().all());
                break;
            case "failed":
                entity = failed(flyway.info().all());
                break;
            case "future":
                entity = future(flyway.info().all());
                break;
            case "latest": {
                MigrationInfo[] migrationInfos = flyway.info().all();
                if (migrationInfos.length == 0)
                    throw new NotFoundException();
                entity = migrationInfos[migrationInfos.length - 1];
                break;
            }
            default:
                for (MigrationInfo info : flyway.info().all()) {
                    if (revision.equalsIgnoreCase(info.getVersion().getVersion())) {
                        entity = info;
                        break;
                    }
                }
        }
        if (entity == null)
            throw new NotFoundException();
        return Response.ok(entity).build();
    }
1249839
@POST
    @Path("{id}/migrate")
    public CreateEmoApiKeyResponse migrateApiKey(@PathParam("id") String id, @QueryParam("key") String key,
                                                 @Authenticated Subject subject) {
        MigrateEmoApiKeyRequest request = new MigrateEmoApiKeyRequest(id);
        if (key != null) {
            request.setCustomRequestParameter("key", key);
        }
        String newKey = _uac.migrateApiKey(subject, request);
        // Even though we're technically not creating a new API key the response object is the same
        return new CreateEmoApiKeyResponse(newKey, id);
    }
1032225
public function getMigration() {
        $query = $this->db()->createQueryBuilder()
          ->select('m.*')
          ->from($this->table, 'm')
          ->where('migration = ?')
          ->setParameter(0, get_class($this));
        $results = $query->execute();
        $migration = $results->fetch();

        if (!$migration) {
            $this->create();
            return true; //Is not in the DB so is new and is pending
        }

        return $migration;
    }
1354530
protected Response get() {
        RequestBuilder getRequest = RequestBuilder.get().setUri(url);
        return executeHttpRequest(getRequest);
    }
903940
public function getVersion()
    {
        if ($this->version === null) {
            $response = $this->httpClient->request('GET', '/');
            if ($response->status != 200) {
                throw HTTPException::fromResponse('/', $response);
            }

            $this->version = $response->body['version'];
        }

        return $this->version;
    }
440316
public function getMigrations()
    {
        if (null === $this->migrations) {
            $phpFiles = $this->getMigrationFiles();

            // filter the files to only get the ones that match our naming scheme
            $fileNames = [];
            /** @var AbstractMigration[] $versions */
            $versions = [];

            foreach ($phpFiles as $filePath) {
                if (Util::isValidMigrationFileName(basename($filePath))) {
                    $version = Util::getVersionFromFileName(basename($filePath));

                    if (isset($versions[$version])) {
                        throw new \InvalidArgumentException(sprintf('Duplicate migration - "%s" has the same version as "%s"',
                            $filePath, $versions[$version]->getVersion()));
                    }

                    $config = $this->getConfig();
                    $namespace = $config->getMigrationNamespaceByPath(dirname($filePath));

                    // convert the filename to a class name
                    $class = (null === $namespace ? '' : $namespace . '\\') . Util::mapFileNameToClassName(basename($filePath));

                    if (isset($fileNames[$class])) {
                        throw new \InvalidArgumentException(sprintf(
                            'Migration "%s" has the same name as "%s"',
                            basename($filePath),
                            $fileNames[$class]
                        ));
                    }

                    $fileNames[$class] = basename($filePath);

                    // load the migration file
                    /** @noinspection PhpIncludeInspection */
                    require_once $filePath;
                    if (!class_exists($class)) {
                        throw new \InvalidArgumentException(sprintf(
                            'Could not find class "%s" in file "%s"',
                            $class,
                            $filePath
                        ));
                    }

                    // instantiate it
                    $migration = new $class($version, $this->getCommand());

                    if (!($migration instanceof AbstractMigration)) {
                        throw new \InvalidArgumentException(sprintf(
                            'The class "%s" in file "%s" must extend \Hail\Database\Migration\AbstractMigration',
                            $class,
                            $filePath
                        ));
                    }

                    $versions[$version] = $migration;
                }
            }

            ksort($versions);
            $this->setMigrations($versions);
        }

        return $this->migrations;
    }
698039
public function index()
    {
        try {
            $uri = null;
            if ($this->hasRequestParameter("uri")) {
                $uri = $this->getRequestParameter("uri");
                if (!common_Utils::isUri($uri)) {
                    throw new common_exception_InvalidArgumentType();
                }
            }

            switch ($this->getRequestMethod()) {
                case "GET":
                    $response = $this->get($uri);
                    break;
                case "PUT":
                    $response = $this->put($uri);
                    break;
                case "POST":
                    $response = $this->post();
                    break;
                case "DELETE":
                    $response = $this->delete($uri);
                    break;
                default:
                    throw new common_exception_BadRequest($this->getRequestURI());
            }

            $this->returnSuccess($response);

        } catch (Exception $e) {
            if ($e instanceof \common_exception_ValidationFailed &&
                $alias = $this->reverseSearchAlias($e->getField())
            ) {
                $e = new \common_exception_ValidationFailed($alias, null, $e->getCode());
            }

            $this->returnFailure($e);
        }
    }
387663
protected function getImportedCommits()
    {
        $environment = $this->getEnvironment();
        $slug = $environment['slug'];
        $branch = $environment['branch'];

        $imported = $this->api->get("/api/v1/$slug/$branch");
        if ($imported === false) {
            throw new Exception('Failed to reach API.');
        }

        return json_decode($imported, true);
    }
1340578
public ApiResponse<ApiEndpointsSuccess> getApiEndpointsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getApiEndpointsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<ApiEndpointsSuccess>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
722817
public function check()
    {
        try {
            return $this->json($this->manager()->checkPackage());
        } catch (PackageManagerException $e) {
            return $this->getJsonException($e);
        }
    }
187784
private function getUpdatedEntityResponse()
    {
        $response = $this->getEditionResponse();
        try {
            // Try to store an entity with the data in the request.
            $this->storeEntity();
            $response->addNotice(sprintf(
                _('%s correctly stored.'),
                ucfirst($this->getItemName())
            ));
        } catch (ValidatorException $exception) {
            // The entity could not be stored because of a validation error.
            // Add the error data to the response.
            $response->addErrorMessage(array(
                'validation' => $exception->getValidationStatus(),
            ));
        } catch (\Exception $exception) {
            // An unexpected error has occurred. Display the edition
            // page again.
            $response->addErrorMessage($exception->getMessage());
        }
        // Set the entity data into the response.
        $response->setData(
            $this->getItemName(),
            $this->getEntityData()
        );

        return $response;
    }
327078
public ApiResponse<GetStatisticDefinitionsResponse> getStatisticDefinitionsWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getStatisticDefinitionsValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<GetStatisticDefinitionsResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }