{"id":18051716,"url":"https://github.com/apimatic/calculator-sdk","last_synced_at":"2025-04-05T07:13:42.581Z","repository":{"id":57732451,"uuid":"464351316","full_name":"apimatic/calculator-sdk","owner":"apimatic","description":"This repo is published on maven central. This is a simple calculator SDK generated through APIMatic (https://www.apimatic.io) that deals with auto generated Rest API client SDKs along with proper test coverage and documentation.","archived":false,"fork":false,"pushed_at":"2022-09-30T18:49:04.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-29T17:49:34.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apimatic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-28T05:33:18.000Z","updated_at":"2022-02-28T06:41:39.000Z","dependencies_parsed_at":"2022-09-10T20:31:15.095Z","dependency_job_id":null,"html_url":"https://github.com/apimatic/calculator-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fcalculator-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fcalculator-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fcalculator-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apimatic%2Fcalculator-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apimatic","download_url":"https://codeload.github.com/apimatic/calculator-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299850,"owners_count":20916193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T22:55:14.383Z","updated_at":"2025-04-05T07:13:42.565Z","avatar_url":"https://github.com/apimatic.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Getting Started with APIMATIC Calculator\n\n## Introduction\n\nSimple calculator API hosted on APIMATIC\n\n## Building\n\nThe generated code uses a few Maven dependencies e.g., Jackson, OkHttp,\nand Apache HttpClient. The reference to these dependencies is already\nadded in the pom.xml file will be installed automatically. Therefore,\nyou will need internet access for a successful build.\n\n* In order to open the client library in Eclipse click on `File -\u003e Import`.\n\n![Importing SDK into Eclipse - Step 1](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=import0)\n\n* In the import dialog, select `Existing Java Project` and click `Next`.\n\n![Importing SDK into Eclipse - Step 2](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=import1)\n\n* Browse to locate the folder containing the source code. Select the detected location of the project and click `Finish`.\n\n![Importing SDK into Eclipse - Step 3](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=import2)\n\n* Upon successful import, the project will be automatically built by Eclipse after automatically resolving the dependencies.\n\n![Importing SDK into Eclipse - Step 4](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=import3)\n\n## Installation\n\nThe following section explains how to use the APIMATICCalculatorLib library in a new project.\n\n### 1. Starting a new project\n\nFor starting a new project, click the menu command `File \u003e New \u003e Project`.\n\n![Add a new project in Eclipse](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=createNewProject0)\n\nNext, choose `Maven \u003e Maven Project` and click `Next`.\n\n![Create a new Maven Project - Step 1](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=createNewProject1)\n\nHere, make sure to use the current workspace by choosing `Use default Workspace location`, as shown in the picture below and click `Next`.\n\n![Create a new Maven Project - Step 2](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=createNewProject2)\n\nFollowing this, select the *quick start* project type to create a simple project with an existing class and a `main` method. To do this, choose `maven-archetype-quickstart` item from the list and click `Next`.\n\n![Create a new Maven Project - Step 3](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=createNewProject3)\n\nIn the last step, provide a `Group Id` and `Artifact Id` as shown in the picture below and click `Finish`.\n\n![Create a new Maven Project - Step 4](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=createNewProject4)\n\n### 2. Add reference of the library project\n\nThe created Maven project manages its dependencies using its `pom.xml` file. In order to add a dependency on the *APIMATICCalculatorLib* client library, double click on the `pom.xml` file in the `Package Explorer`. Opening the `pom.xml` file will render a graphical view on the canvas. Here, switch to the `Dependencies` tab and click the `Add` button as shown in the picture below.\n\n![Adding dependency to the client library - Step 1](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=testProject0)\n\nClicking the `Add` button will open a dialog where you need to specify APIMATICCalculatorLib in `Group Id`, apimaticcalculator-lib in `Artifact Id` and 1.0.0 in the `Version` fields. Once added click `OK`. Save the `pom.xml` file.\n\n![Adding dependency to the client library - Step 2](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=testProject1)\n\n![Adding sample code](https://apidocs.io/illustration/java?workspaceFolder=APIMATIC%20Calculator-Java\u0026workspaceName=APIMATICCalculator\u0026projectName=APIMATICCalculatorLib\u0026rootNamespace=io.apimatic.examples\u0026groupId=APIMATICCalculatorLib\u0026artifactId=apimaticcalculator-lib\u0026version=1.0.0\u0026step=testProject2)\n\n### 3. Write sample code\n\nOnce the `SimpleConsoleApp` is created, a file named `App.java` will be visible in the *Package Explorer* with a `main` method. This is the entry point for the execution of the created project.\nHere, you can add code to initialize the client library and instantiate a *Controller* class. Sample code to initialize the client library and using controller methods is given in the subsequent sections.\n\n## Test the SDK\n\nThe generated code and the server can be tested using automatically generated test cases.\nJUnit is used as the testing framework and test runner.\n\nIn Eclipse, for running the tests do the following:\n\n1. Select the project APIMATICCalculatorLib from the package explorer.\n2. Select `Run -\u003e Run as -\u003e JUnit Test` or use `Alt + Shift + X` followed by `T` to run the Tests.\n\n## Initialize the API Client\n\n**_Note:_** Documentation for the client can be found [here.](/doc/client.md)\n\nThe following parameters are configurable for the API Client:\n\n| Parameter | Type | Description |\n|  --- | --- | --- |\n| `environment` | Environment | The API environment. \u003cbr\u003e **Default: `Environment.PRODUCTION`** |\n| `httpClientConfig` | `ReadonlyHttpClientConfiguration` | Http Client Configuration instance.\u003cbr\u003e* See available [builder methods here](/doc/http-client-configuration-builder.md). |\n\nThe API client can be initialized as follows:\n\n```java\nAPIMATICCalculatorClient client = new APIMATICCalculatorClient.Builder()\n    .httpClientConfig(configBuilder -\u003e configBuilder\n            .timeout(0))\n    .environment(Environment.PRODUCTION)\n    .build();\n```\n\n## List of APIs\n\n* [Simple Calculator](/doc/controllers/simple-calculator.md)\n\n## Classes Documentation\n\n* [Utility Classes](/doc/utility-classes.md)\n* [HttpRequest](/doc/http-request.md)\n* [HttpResponse](/doc/http-response.md)\n* [HttpStringResponse](/doc/http-string-response.md)\n* [HttpContext](/doc/http-context.md)\n* [HttpBodyRequest](/doc/http-body-request.md)\n* [HttpCallback Interface](/doc/http-callback-interface.md)\n* [Headers](/doc/headers.md)\n* [ApiException](/doc/api-exception.md)\n* [Configuration Interface](/doc/configuration-interface.md)\n* [HttpClientConfiguration](/doc/http-client-configuration.md)\n* [HttpClientConfiguration.Builder](/doc/http-client-configuration-builder.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimatic%2Fcalculator-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapimatic%2Fcalculator-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapimatic%2Fcalculator-sdk/lists"}