Skip to content

pakoMazagon/mesas

Repository files navigation

openapi-java-client

ms-productos

  • API version: 0.0.1

  • Build date: 2022-03-15T13:44:13.089166500+01:00[Europe/Paris]

Microservice for products in bar

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven/Gradle

Installation

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

mvn clean install

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

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>org.openapitools</groupId>
  <artifactId>openapi-java-client</artifactId>
  <version>0.0.1</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "org.openapitools:openapi-java-client:0.0.1"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/openapi-java-client-0.0.1.jar
  • target/lib/*.jar

Getting Started

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

import rest.elchoco.mesas.openAPI.client.*;
import rest.elchoco.mesas.openAPI.client.auth.*;
import rest.elchoco.mesas.openAPI.dto.products.*;
import rest.elchoco.mesas.openAPI.api.ProductApi;

public class ProductApiExample {

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

        ProductApi apiInstance = new ProductApi(defaultClient);
        ProductCreateRDTO body = new ProductCreateRDTO(); // ProductCreateRDTO | Product object that needs to be added
        try {
            ProductCreateRDTO result = apiInstance.addProduct(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ProductApi#addProduct");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
ProductApi addProduct POST /products Add a new product
ProductApi findAllProducts GET /products Find all products
ProductApi findAllProductsByPlace GET /products/byPlace/{terraceOrSalon} Find all products by place
ProductApi findAllProductsByPlaceAndFamilyCode GET /products/byPlaceAndFamilyCode/{terraceOrSalon}/{familyCode} Find all products by place and family
ProductApi findProductsByFamily GET /products/byFamily/{familyCode} Find products by familyCode
ProductApi findProductsByName GET /products/byName/{name} Find product by name
ProductApi findProductsByPlaceAndName GET /products/byPlaceAndName/{terraceOrSalon}/{name} Find product by name and place
ProductApi productsByNameNameDelete DELETE /products/byName/{name} Delete product by name
ProductApi updateProduct PUT /products Update or create an existing product

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

x-jwt-assertion

  • Type: API key
  • API key parameter name: x-jwt-assertion
  • Location: HTTP header

Recommendation

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

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published