Giter Club home page Giter Club logo

autorest-clientruntime-for-java's Introduction

Build Status

AutoRest Client Runtimes for Java

The runtime libraries for AutoRest generated Java clients.

Usage

Prerequisites

  • JDK 1.7

Download

<dependency>
  <groupId>com.microsoft.rest</groupId>
  <artifactId>client-runtime</artifactId>
  <version>1.0.0</version>
</dependency>

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-client-runtime</artifactId>
  <version>1.0.0</version>
</dependency>

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-client-authentication</artifactId>
  <version>1.0.0-beta6-SNAPSHOT</version>
</dependency>

Create a RestClient

// For Java genenerator
RestClient simpleClient = new RestClient.Builder()
    .withBaseUrl("http://localhost")
    .withResponseBuilderFactory(new ServiceResponseBuilder.Factory())
  	.withSerializerAdapter(new JacksonAdapter())
  	.build();
AutoRestJavaClient client1 = new AutoRestJavaClientImpl(simpleClient);

// For Azure.Java generator
RestClient azureClient = new RestClient.Builder()
    .withBaseUrl(AzureEnvironment.Azure, Endpoint.RESOURCE_MANAGER)
    .withResponseBuilderFactory(new AzureResponseBuilder.Factory())
  	.withSerializerAdapter(new AzureJacksonAdapter())
    .withCredentials(AzureCliCredentials.create())
  	.build();
FooServiceClient client2 = new FooServiceClientImpl(azureClient);

// For Azure SDK users
Azure azure = Azure.authenticate(azureClient).withDefaultSubscription();

Components

client-runtime

This is the generic runtime. Add this package as a dependency if you are using Java generator in AutoRest. This package depends on Retrofit, OkHttp, Jackson, RxJava for making and processing REST requests.

azure-client-runtime

This is the runtime with Azure specific customizations. Add this package as a dependency if you are using Azure.Java or Azure.Java.Fluent generator in AutoRest.

This combination provides a set of Azure specific behaviors, including long running operations, special handling of HEAD operations, and paginated list() calls.

azure-client-authentication (beta)

This package provides access to Active Directory authentication on JDK using OrgId or application ID / secret combinations. There are currently 3 types of authentication provided:

  • Service principal authentication: ApplicationTokenCredentials
  • Username / password login without multi-factor auth: UserTokenCredentials
  • Use the credentials logged in Azure CLI: AzureCliCredentials

azure-android-client-authentication (beta)

This package provides access to Active Directory authentication on Android. You can login with Microsoft accounts, OrgId, with or without multi-factor auth.

Build

To build this repository, you will need maven 2.0+ and gradle 1.6+. Maven is used for Java SDK when it's used as a submodule in there. Gradle is used for AutoRest when it's used as a submodule in there.

Contributing

This repository is for runtime & authentication specifically. For issues in the generated code, please report in AutoRest. For bugs in the Azure SDK, please report in Azure SDK for Java. If you are unsure, please file here and state that clearly in the issue. Pull requests are welcomed with clear Javadocs.

autorest-clientruntime-for-java's People

Contributors

abhivijay96 avatar amarzavery avatar annatisch avatar anuchandy avatar begoldsm avatar bretjohnson avatar brjohnstmsft avatar brnleehng avatar brodyberg avatar burtbiel avatar devigned avatar dtretyakov avatar fearthecowboy avatar jhancock93 avatar jianghaolu avatar jkonecki avatar john-hart avatar lmazuel avatar markcowl avatar matthchr avatar nicklebedev37 avatar niklasgustafsson avatar ogail avatar pomortaz avatar stankovski avatar tbombach avatar veronicagg avatar vishrutshah avatar xingwu1 avatar yugangw-msft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.