Skip to content

Commit

Permalink
Merge pull request #11 from amardeshbd/feature/open_api_generated_lib
Browse files Browse the repository at this point in the history
Feature/open api generated lib
Fixes #5
  • Loading branch information
amardeshbd authored Sep 20, 2016
2 parents 7248303 + 31e7897 commit a2de9af
Show file tree
Hide file tree
Showing 24 changed files with 2,237 additions and 20 deletions.
2 changes: 1 addition & 1 deletion api-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies {
compile "io.swagger:swagger-annotations:$rootProject.swaggerVersion"

// Apache Oltu - https://oltu.apache.org/
compile ('org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2') {
compile ('org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.1') {
/*
* NOTE: Swagger generated client library depends on "org.apache.oltu.oauth2.client", which
* includes classes from "org.apache.oltu.oauth2.common". So, we explicitly need to exclude
Expand Down
29 changes: 29 additions & 0 deletions api-lib/docs/Article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# Article

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**section** | **String** | | [optional]
**subsection** | **String** | | [optional]
**title** | **String** | | [optional]
**_abstract** | **String** | | [optional]
**url** | **String** | | [optional]
**thumbnailStandard** | **String** | | [optional]
**shortUrl** | **String** | | [optional]
**byline** | **String** | | [optional]
**itemType** | **String** | | [optional]
**updatedDate** | **String** | | [optional]
**createdDate** | **String** | | [optional]
**publishedDate** | **String** | | [optional]
**materialTypeFacet** | **String** | | [optional]
**kicker** | **String** | | [optional]
**desFacet** | **List<String>** | | [optional]
**orgFacet** | **String** | | [optional]
**perFacet** | **List<String>** | | [optional]
**geoFacet** | **List<String>** | | [optional]
**multimedia** | [**List<ArticleMultimedia>**](ArticleMultimedia.md) | | [optional]
**relatedUrls** | [**List<ArticleRelatedUrls>**](ArticleRelatedUrls.md) | | [optional]



17 changes: 17 additions & 0 deletions api-lib/docs/ArticleMultimedia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# ArticleMultimedia

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | **String** | | [optional]
**format** | **String** | | [optional]
**height** | **Integer** | | [optional]
**width** | **Integer** | | [optional]
**type** | **String** | | [optional]
**subtype** | **String** | | [optional]
**caption** | **String** | | [optional]
**copyright** | **String** | | [optional]



11 changes: 11 additions & 0 deletions api-lib/docs/ArticleRelatedUrls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# ArticleRelatedUrls

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**suggestedLinkText** | **String** | | [optional]
**url** | **String** | | [optional]



10 changes: 10 additions & 0 deletions api-lib/docs/InlineResponse200.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# InlineResponse200

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**results** | [**List<Article>**](Article.md) | | [optional]



68 changes: 68 additions & 0 deletions api-lib/docs/StoriesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# StoriesApi

All URIs are relative to *http://api.nytimes.com/svc/topstories/v2/*

Method | HTTP request | Description
------------- | ------------- | -------------
[**sectionFormatGet**](StoriesApi.md#sectionFormatGet) | **GET** {section}.{format} | Top Stories


<a name="sectionFormatGet"></a>
# **sectionFormatGet**
> InlineResponse200 sectionFormatGet(section, format, callback)
Top Stories

The Top Stories API provides JSON and JSONP lists of articles and associated images by section.

### Example
```java
// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.StoriesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: apikey
ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey");
apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apikey.setApiKeyPrefix("Token");

StoriesApi apiInstance = new StoriesApi();
String section = "section_example"; // String | The section the story appears in.
String format = "format_example"; // String | if this is JSONP or JSON
String callback = "callback_example"; // String | The name of the function the API call results will be passed to. Required when using JSONP. This parameter has only one valid value per section. The format is {section_name}TopStoriesCallback.
try {
InlineResponse200 result = apiInstance.sectionFormatGet(section, format, callback);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoriesApi#sectionFormatGet");
e.printStackTrace();
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**section** | **String**| The section the story appears in. | [enum: home, opinion, world, national, politics, upshot, nyregion, business, technology, science, health, sports, arts, books, movies, theater, sundayreview, fashion, tmagazine, food, travel, magazine, realestate, automobiles, obituaries, insider]
**format** | **String**| if this is JSONP or JSON | [enum: json, jsonp]
**callback** | **String**| The name of the function the API call results will be passed to. Required when using JSONP. This parameter has only one valid value per section. The format is {section_name}TopStoriesCallback. | [optional]

### Return type

[**InlineResponse200**](InlineResponse200.md)

### Authorization

[apikey](../README.md#apikey)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

11 changes: 2 additions & 9 deletions api-lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.hossainkhan.android.api.core">

<application android:allowBackup="true"
android:supportsRtl="true"
>

</application>

<manifest package="io.swagger.client" xmlns:android="http://schemas.android.com/apk/res/android">
<application />
</manifest>
5 changes: 0 additions & 5 deletions api-lib/src/main/java/com/example/ApiCore.java

This file was deleted.

Loading

0 comments on commit a2de9af

Please sign in to comment.