swagger-java-client

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project’s POM:

<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-java-client</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project’s build file:

compile "io.swagger:swagger-java-client:1.0.0"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/swagger-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import name.kevinlocke.appveyor.*;
import name.kevinlocke.appveyor.auth.*;
import name.kevinlocke.appveyor.model.*;
import name.kevinlocke.appveyor.api.BuildApi;

import java.io.File;
import java.util.*;

public class BuildApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: apiToken
        ApiKeyAuth apiToken = (ApiKeyAuth) defaultClient.getAuthentication("apiToken");
        apiToken.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //apiToken.setApiKeyPrefix("Token");

        BuildApi apiInstance = new BuildApi();
        String accountName = "accountName_example"; // String | AppVeyor account name (`accountName` property of `UserAccount`)
        String projectSlug = "projectSlug_example"; // String | Project Slug
        String buildVersion = "buildVersion_example"; // String | Build Version (`version` property of `Build`)
        try {
            apiInstance.cancelBuild(accountName, projectSlug, buildVersion);
        } catch (ApiException e) {
            System.err.println("Exception when calling BuildApi#cancelBuild");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to *https://ci.appveyor.com/api*

Class Method HTTP request Description
BuildApi cancelBuild DELETE /builds/{accountName}/{projectSlug}/{buildVersion} Cancel build
BuildApi getBuildArtifact GET /buildjobs/{jobId}/artifacts/{artifactFileName} Download build artifact
BuildApi getBuildArtifacts GET /buildjobs/{jobId}/artifacts Get build artifacts
BuildApi getBuildLog GET /buildjobs/{jobId}/log Download build log
BuildApi startBuild POST /builds Start build of branch most recent commit
CollaboratorApi addCollaborator POST /collaborators Add collaborator
CollaboratorApi deleteCollaborator DELETE /collaborators/{userId} Delete collaborator
CollaboratorApi getCollaborator GET /collaborators/{userId} Get collaborator
CollaboratorApi getCollaborators GET /collaborators Get collaborators
CollaboratorApi updateCollaborator PUT /collaborators Update collaborator
DeploymentApi cancelDeployment DELETE /deployments/stop Cancel deployment
DeploymentApi getDeployment GET /deployments/{deploymentId} Get deployment
DeploymentApi startDeployment POST /deployments Start deployment
EnvironmentApi addEnvironment POST /environments Add environment
EnvironmentApi deleteEnvironment DELETE /environments/{deploymentEnvironmentId} Delete environment
EnvironmentApi getEnvironmentDeployments GET /environments/{deploymentEnvironmentId}/deployments Get environment deployments
EnvironmentApi getEnvironmentSettings GET /environments/{deploymentEnvironmentId}/settings Get environment settings
EnvironmentApi getEnvironments GET /environments Get environments
EnvironmentApi updateEnvironment PUT /environments Update environment
ProjectApi addProject POST /projects Add project
ProjectApi deleteProject DELETE /projects/{accountName}/{projectSlug} Delete project
ProjectApi deleteProjectBuildCache DELETE /projects/{accountName}/{projectSlug}/buildcache Delete project build cache
ProjectApi encryptValue POST /account/encrypt Encrypt a value for use in StoredValue.
ProjectApi getProjectArtifact GET /projects/{accountName}/{projectSlug}/artifacts/{artifactFileName} Get last successful build artifact
ProjectApi getProjectBranchStatusBadge GET /projects/status/{statusBadgeId}/branch/{buildBranch} Get project branch status badge image
ProjectApi getProjectBuildByVersion GET /projects/{accountName}/{projectSlug}/build/{buildVersion} Get project build by version
ProjectApi getProjectDeployments GET /projects/{accountName}/{projectSlug}/deployments Get project deployments
ProjectApi getProjectEnvironmentVariables GET /projects/{accountName}/{projectSlug}/settings/environment-variables Get project environment variables
ProjectApi getProjectHistory GET /projects/{accountName}/{projectSlug}/history Get project history
ProjectApi getProjectLastBuild GET /projects/{accountName}/{projectSlug} Get project last build
ProjectApi getProjectLastBuildBranch GET /projects/{accountName}/{projectSlug}/branch/{buildBranch} Get project last branch build
ProjectApi getProjectSettings GET /projects/{accountName}/{projectSlug}/settings Get project settings
ProjectApi getProjectSettingsYaml GET /projects/{accountName}/{projectSlug}/settings/yaml Get project settings in YAML
ProjectApi getProjectStatusBadge GET /projects/status/{statusBadgeId} Get project status badge image
ProjectApi getProjects GET /projects Get projects
ProjectApi getPublicProjectStatusBadge GET /projects/status/{badgeRepoProvider}/{repoAccountName}/{repoSlug} Get status badge image for a project with a public repository
ProjectApi updateProject PUT /projects Update project
ProjectApi updateProjectBuildNumber PUT /projects/{accountName}/{projectSlug}/settings/build-number Update project build number
ProjectApi updateProjectEnvironmentVariables PUT /projects/{accountName}/{projectSlug}/settings/environment-variables Update project environment variables
ProjectApi updateProjectSettingsYaml PUT /projects/{accountName}/{projectSlug}/settings/yaml Update project settings in YAML
RoleApi addRole POST /roles Add role
RoleApi deleteRole DELETE /roles/{roleId} Delete role
RoleApi getRole GET /roles/{roleId} Get role
RoleApi getRoles GET /roles Get roles
RoleApi updateRole PUT /roles Update role
UserApi addUser POST /users Add user
UserApi deleteUser DELETE /users/{userId} Delete user
UserApi getUser GET /users/{userId} Get user
UserApi getUsers GET /users Get users
UserApi updateUser PUT /users Update user

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

apiToken

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

It’s recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.