-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_test.spec.ts
90 lines (85 loc) · 6.55 KB
/
api_test.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* Chomp Food & Recipe Database API Documentation
* ## Important An **[API key](https://chompthis.com/api/)** is required for access to this API. * Get a **Food Data API** key at **[https://chompthis.com/api](https://chompthis.com/api/)**. * Get a **Recipe Data API** key at **[https://chompthis.com/api/recipes](https://chompthis.com/api/recipes/)**. ### Getting Started * Subscribe to the **[Food Data API](https://chompthis.com/api/#pricing)** or the **[Recipe Data API](https://chompthis.com/api/recipes/#pricing)**. * Scroll down and click the \"**Authorize**\" button. * Enter your API key into the \"**value**\" input, click the \"**Authorize**\" button, then click the \"**Close**\" button. * Scroll down to the section titled \"**default**\" and click on the API endpoint you wish to use. * Click the \"**Try it out**\" button. * Enter the information the endpoint requires. * Click the \"**Execute**\" button. ### Example * Branded food response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/branded-food-response-object.json)** * Ingredient response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/ingredient-response-object.json)** * Recipe response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/example-recipe-response.json)** * Error response object: **[View example »](https://raw.githubusercontent.com/chompfoods/examples/master/error-response-object.json)** ### How Do I Find My API Key? * Your API key was sent to the email address you used to create your subscription. * You will also find your API key in the **[Client Center](https://chompthis.com/api/manage.php)**. * Read **[this article](https://desk.zoho.com/portal/chompthis/kb/articles/how-do-i-find-my-api-key)** for more information. ### I'm a Premium subscriber. How do I access the API? * All Premium subscribers must pass in a unique user ID for each user on their platform that is accessing data from the Chomp API. A user ID can be any string of letters and numbers that you assign to your user. Simply add \"user_id\" as a URL parameter when calling the API. *You must add a \"user_id\" URL parameter to every call you make to ANY endpoint.* * **Example** > ```ENDPOINT.php?api_key=API_KEY&code=CODE&user_id=USER_ID``` ### Helpful Links * **Help & Support** * [Knowledge Base »](https://desk.zoho.com/portal/chompthis/kb/chomp) * [Support »](https://chompthis.com/api/ticket-new.php) * [Client Center »](https://chompthis.com/api/manage.php) * **Pricing** * [Food Data API Subscription Options »](https://chompthis.com/api/) * [Recipe Data API Subscription Options »](https://chompthis.com/api/recipes/) * [Food Data API Cost Calculator »](https://chompthis.com/api/cost-calculator.php) * [Recipe Data API Cost Calculator »](https://chompthis.com/api/recipes/cost-calculator.php) * **Guidelines** * [Terms & License »](https://chompthis.com/api/terms.php) * [Attribution »](https://chompthis.com/api/docs/attribution.php)
*
* OpenAPI spec version: 1.0.0-oas3
*
*
* NOTE: This file is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the file manually.
*/
import * as api from "./api"
import { Configuration } from "./configuration"
const config: Configuration = {}
describe("DefaultApi", () => {
let instance: api.DefaultApi
beforeEach(function() {
instance = new api.DefaultApi(config)
});
test("foodBrandedBarcodePhpGet", () => {
const code: string = "code_example"
const userId: string = "userId_example"
return expect(instance.foodBrandedBarcodePhpGet(code, userId, {})).resolves.toBe(null)
})
test("foodBrandedNamePhpGet", () => {
const name: string = "name_example"
const limit: number = 56
const page: number = 56
const userId: string = "userId_example"
return expect(instance.foodBrandedNamePhpGet(name, limit, page, userId, {})).resolves.toBe(null)
})
test("foodBrandedSearchPhpGet", () => {
const allergen: string = "allergen_example"
const brand: string = "brand_example"
const category: string = "category_example"
const country: string = "country_example"
const diet: string = "diet_example"
const ingredient: string = "ingredient_example"
const keyword: string = "keyword_example"
const mineral: string = "mineral_example"
const nutrient: string = "nutrient_example"
const palmOil: string = "palmOil_example"
const trace: string = "trace_example"
const vitamin: string = "vitamin_example"
const limit: number = 56
const page: number = 56
const userId: string = "userId_example"
return expect(instance.foodBrandedSearchPhpGet(allergen, brand, category, country, diet, ingredient, keyword, mineral, nutrient, palmOil, trace, vitamin, limit, page, userId, {})).resolves.toBe(null)
})
test("foodIngredientSearchPhpGet", () => {
const find: string = "find_example"
const limit: number = 56
const userId: string = "userId_example"
return expect(instance.foodIngredientSearchPhpGet(find, limit, userId, {})).resolves.toBe(null)
})
test("recipeIdPhpGet", () => {
const id: string = "id_example"
const userId: string = "userId_example"
return expect(instance.recipeIdPhpGet(id, userId, {})).resolves.toBe(null)
})
test("recipeIngredientPhpGet", () => {
const list: string = "list_example"
const limit: number = 56
const page: number = 56
const userId: string = "userId_example"
return expect(instance.recipeIngredientPhpGet(list, limit, page, userId, {})).resolves.toBe(null)
})
test("recipeRandomPhpGet", () => {
const limit: number = 56
const userId: string = "userId_example"
return expect(instance.recipeRandomPhpGet(limit, userId, {})).resolves.toBe(null)
})
test("recipeSearchPhpGet", () => {
const title: string = "title_example"
const excludedCuisine: string = "excludedCuisine_example"
const includedCuisine: string = "includedCuisine_example"
const excludedIngredient: string = "excludedIngredient_example"
const includedIngredient: string = "includedIngredient_example"
const nutrientsRequired: number = 56
const limit: number = 56
const page: number = 56
const userId: string = "userId_example"
return expect(instance.recipeSearchPhpGet(title, excludedCuisine, includedCuisine, excludedIngredient, includedIngredient, nutrientsRequired, limit, page, userId, {})).resolves.toBe(null)
})
})