diff --git a/doc/index.html b/doc/index.html index e6fa52f..84b1b8f 100755 --- a/doc/index.html +++ b/doc/index.html @@ -5719,6 +5719,9 @@
  • getProject
  • +
  • + getProjectById +
  • getProjectList
  • @@ -31205,6 +31208,412 @@


    +
    +
    +
    +

    getProjectById

    +

    Get project details

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/project/{projectId}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET \
    +-H "api-key: [[apiKey]]" \
    + -H "Accept: application/json" \
    + "https://app.sentio.xyz/api/v1/project/{projectId}"
    +
    +
    +
    +
    import org.openapitools.client.*;
    +import org.openapitools.client.auth.*;
    +import org.openapitools.client.model.*;
    +import org.openapitools.client.api.WebApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class WebApiExample {
    +    public static void main(String[] args) {
    +        ApiClient defaultClient = Configuration.getDefaultApiClient();
    +
    +        // Configure API key authorization: ApiKeyAuth
    +        ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
    +        ApiKeyAuth.setApiKey("YOUR API KEY");
    +        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +        //ApiKeyAuth.setApiKeyPrefix("Token");
    +
    +        // Create an instance of the API class
    +        WebApi apiInstance = new WebApi();
    +        String projectId = projectId_example; // String | 
    +
    +        try {
    +            common.ProjectInfo result = apiInstance.getProjectById(projectId);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling WebApi#getProjectById");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    +
    + +
    +
    import 'package:openapi/api.dart';
    +
    +final api_instance = DefaultApi();
    +
    +final String projectId = new String(); // String | 
    +
    +try {
    +    final result = await api_instance.getProjectById(projectId);
    +    print(result);
    +} catch (e) {
    +    print('Exception when calling DefaultApi->getProjectById: $e\n');
    +}
    +
    +
    +
    + +
    +
    import org.openapitools.client.api.WebApi;
    +
    +public class WebApiExample {
    +    public static void main(String[] args) {
    +        WebApi apiInstance = new WebApi();
    +        String projectId = projectId_example; // String | 
    +
    +        try {
    +            common.ProjectInfo result = apiInstance.getProjectById(projectId);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling WebApi#getProjectById");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Configuration *apiConfig = [Configuration sharedConfig];
    +
    +// Configure API key authorization: (authentication scheme: ApiKeyAuth)
    +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api-key"];
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api-key"];
    +
    +
    +// Create an instance of the API class
    +WebApi *apiInstance = [[WebApi alloc] init];
    +String *projectId = projectId_example; //  (default to null)
    +
    +// Get project details
    +[apiInstance getProjectByIdWith:projectId
    +              completionHandler: ^(common.ProjectInfo output, NSError* error) {
    +    if (output) {
    +        NSLog(@"%@", output);
    +    }
    +    if (error) {
    +        NSLog(@"Error: %@", error);
    +    }
    +}];
    +
    +
    + +
    +
    var SentioApi = require('sentio_api');
    +var defaultClient = SentioApi.ApiClient.instance;
    +
    +// Configure API key authorization: ApiKeyAuth
    +var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
    +ApiKeyAuth.apiKey = "YOUR API KEY";
    +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    +//ApiKeyAuth.apiKeyPrefix['api-key'] = "Token";
    +
    +// Create an instance of the API class
    +var api = new SentioApi.WebApi()
    +var projectId = projectId_example; // {String} 
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getProjectById(projectId, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using Org.OpenAPITools.Api;
    +using Org.OpenAPITools.Client;
    +using Org.OpenAPITools.Model;
    +
    +namespace Example
    +{
    +    public class getProjectByIdExample
    +    {
    +        public void main()
    +        {
    +            // Configure API key authorization: ApiKeyAuth
    +            Configuration.Default.ApiKey.Add("api-key", "YOUR_API_KEY");
    +            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +            // Configuration.Default.ApiKeyPrefix.Add("api-key", "Bearer");
    +
    +            // Create an instance of the API class
    +            var apiInstance = new WebApi();
    +            var projectId = projectId_example;  // String |  (default to null)
    +
    +            try {
    +                // Get project details
    +                common.ProjectInfo result = apiInstance.getProjectById(projectId);
    +                Debug.WriteLine(result);
    +            } catch (Exception e) {
    +                Debug.Print("Exception when calling WebApi.getProjectById: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +// Configure API key authorization: ApiKeyAuth
    +OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
    +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
    +
    +// Create an instance of the API class
    +$api_instance = new OpenAPITools\Client\Api\WebApi();
    +$projectId = projectId_example; // String | 
    +
    +try {
    +    $result = $api_instance->getProjectById($projectId);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling WebApi->getProjectById: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::OPenAPIClient::Configuration;
    +use WWW::OPenAPIClient::WebApi;
    +
    +# Configure API key authorization: ApiKeyAuth
    +$WWW::OPenAPIClient::Configuration::api_key->{'api-key'} = 'YOUR_API_KEY';
    +# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'api-key'} = "Bearer";
    +
    +# Create an instance of the API class
    +my $api_instance = WWW::OPenAPIClient::WebApi->new();
    +my $projectId = projectId_example; # String | 
    +
    +eval {
    +    my $result = $api_instance->getProjectById(projectId => $projectId);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling WebApi->getProjectById: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import openapi_client
    +from openapi_client.rest import ApiException
    +from pprint import pprint
    +
    +# Configure API key authorization: ApiKeyAuth
    +openapi_client.configuration.api_key['api-key'] = 'YOUR_API_KEY'
    +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    +# openapi_client.configuration.api_key_prefix['api-key'] = 'Bearer'
    +
    +# Create an instance of the API class
    +api_instance = openapi_client.WebApi()
    +projectId = projectId_example # String |  (default to null)
    +
    +try:
    +    # Get project details
    +    api_response = api_instance.get_project_by_id(projectId)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling WebApi->getProjectById: %s\n" % e)
    +
    + +
    +
    extern crate WebApi;
    +
    +pub fn main() {
    +    let projectId = projectId_example; // String
    +
    +    let mut context = WebApi::Context::default();
    +    let result = client.getProjectById(projectId, &context).wait();
    +
    +    println!("{:?}", result);
    +}
    +
    +
    +
    + +

    Scopes

    + + +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + +
    NameDescription
    projectId* + + +
    +
    +
    + + String + + +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    +

    + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    diff --git a/openapi.json b/openapi.json index ebc4bff..4407ba7 100644 --- a/openapi.json +++ b/openapi.json @@ -1298,6 +1298,31 @@ ] } }, + "/api/v1/project/{projectId}": { + "get": { + "summary": "Get project details", + "operationId": "GetProjectById", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/common.ProjectInfo" + } + } + }, + "parameters": [ + { + "name": "projectId", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "Web" + ] + } + }, "/api/v1/projects": { "get": { "summary": "Get project list", diff --git a/src/WebApi.md b/src/WebApi.md index e86edac..a094d80 100755 --- a/src/WebApi.md +++ b/src/WebApi.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**getDashboard**](WebApi.md#getDashboard) | **GET** /api/v1/dashboards/{dashboardId} | Get a dashboard by id [**getDashboard2**](WebApi.md#getDashboard2) | **GET** /api/v1/projects/{owner}/{slug}/dashboards/{dashboardId} | Get a dashboard by id [**getProject**](WebApi.md#getProject) | **GET** /api/v1/project/{owner}/{slug} | Get project details +[**getProjectById**](WebApi.md#getProjectById) | **GET** /api/v1/project/{projectId} | Get project details [**getProjectList**](WebApi.md#getProjectList) | **GET** /api/v1/projects | Get project list [**importDashboard**](WebApi.md#importDashboard) | **POST** /api/v1/dashboards/json | Import a dashboard to another dashboard [**listDashboards**](WebApi.md#listDashboards) | **GET** /api/v1/dashboards | List all dashboards in a project @@ -298,6 +299,58 @@ Name | Type | Description | Notes - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **getProjectById** +> CommonProjectInfo getProjectById() + + +### Example + + +```typescript +import { createConfiguration, WebApi } from ''; +import type { WebApiGetProjectByIdRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new WebApi(configuration); + +const request: WebApiGetProjectByIdRequest = { + + projectId: "projectId_example", +}; + +const data = await apiInstance.getProjectById(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectId** | [**string**] | | defaults to undefined + + +### Return type + +**CommonProjectInfo** + +### Authorization + +[ApiKeyAuth](README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| diff --git a/src/apis/WebApi.ts b/src/apis/WebApi.ts index 67e8c87..023c801 100755 --- a/src/apis/WebApi.ts +++ b/src/apis/WebApi.ts @@ -8,6 +8,7 @@ import {canConsumeForm, isCodeInRange} from '../util.js'; import {SecurityAuthentication} from '../auth/auth.js'; +import { CommonProjectInfo } from '../models/CommonProjectInfo.js'; import { WebServiceDashboard } from '../models/WebServiceDashboard.js'; import { WebServiceExportDashboardResponse } from '../models/WebServiceExportDashboardResponse.js'; import { WebServiceGetDashboardResponse } from '../models/WebServiceGetDashboardResponse.js'; @@ -279,6 +280,43 @@ export class WebApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + /** + * Get project details + * @param projectId + */ + public async getProjectById(projectId: string, _options?: Configuration): Promise { + let _config = _options || this.configuration; + + // verify required parameter 'projectId' is not null or undefined + if (projectId === null || projectId === undefined) { + throw new RequiredError("WebApi", "getProjectById", "projectId"); + } + + + // Path Params + const localVarPath = '/api/v1/project/{projectId}' + .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId))); + + // Make Request Context + const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8") + + + let authMethod: SecurityAuthentication | undefined; + // Apply auth methods + authMethod = _config.authMethods["ApiKeyAuth"] + if (authMethod?.applySecurityAuthentication) { + await authMethod?.applySecurityAuthentication(requestContext); + } + + const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default + if (defaultAuth?.applySecurityAuthentication) { + await defaultAuth?.applySecurityAuthentication(requestContext); + } + + return requestContext; + } + /** * Get project list * @param userId @@ -634,6 +672,35 @@ export class WebApiResponseProcessor { throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getProjectById + * @throws ApiException if the response code was not in [200, 299] + */ + public async getProjectByIdWithHttpInfo(response: ResponseContext): Promise> { + const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: CommonProjectInfo = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CommonProjectInfo", "" + ) as CommonProjectInfo; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CommonProjectInfo = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CommonProjectInfo", "" + ) as CommonProjectInfo; + return new HttpInfo(response.httpStatusCode, response.headers, response.body, body); + } + + throw new ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects diff --git a/src/types/ObjectParamAPI.ts b/src/types/ObjectParamAPI.ts index 37dc76a..955b461 100755 --- a/src/types/ObjectParamAPI.ts +++ b/src/types/ObjectParamAPI.ts @@ -2619,6 +2619,16 @@ export interface WebApiGetProjectRequest { slug: string } +export interface WebApiGetProjectByIdRequest { + /** + * + * Defaults to: undefined + * @type string + * @memberof WebApigetProjectById + */ + projectId: string +} + export interface WebApiGetProjectListRequest { /** * @@ -2794,6 +2804,22 @@ export class ObjectWebApi { return this.api.getProject(param.owner, param.slug, options).toPromise(); } + /** + * Get project details + * @param param the request object + */ + public getProjectByIdWithHttpInfo(param: WebApiGetProjectByIdRequest, options?: Configuration): Promise> { + return this.api.getProjectByIdWithHttpInfo(param.projectId, options).toPromise(); + } + + /** + * Get project details + * @param param the request object + */ + public getProjectById(param: WebApiGetProjectByIdRequest, options?: Configuration): Promise { + return this.api.getProjectById(param.projectId, options).toPromise(); + } + /** * Get project list * @param param the request object diff --git a/src/types/ObservableAPI.ts b/src/types/ObservableAPI.ts index 62a1a7d..ae4cab2 100755 --- a/src/types/ObservableAPI.ts +++ b/src/types/ObservableAPI.ts @@ -2227,6 +2227,37 @@ export class ObservableWebApi { return this.getProjectWithHttpInfo(owner, slug, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); } + /** + * Get project details + * @param projectId + */ + public getProjectByIdWithHttpInfo(projectId: string, _options?: Configuration): Observable> { + const requestContextPromise = this.requestFactory.getProjectById(projectId, _options); + + // build promise chain + let middlewarePreObservable = from(requestContextPromise); + for (const middleware of this.configuration.middleware) { + middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx))); + } + + return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))). + pipe(mergeMap((response: ResponseContext) => { + let middlewarePostObservable = of(response); + for (const middleware of this.configuration.middleware) { + middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp))); + } + return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getProjectByIdWithHttpInfo(rsp))); + })); + } + + /** + * Get project details + * @param projectId + */ + public getProjectById(projectId: string, _options?: Configuration): Observable { + return this.getProjectByIdWithHttpInfo(projectId, _options).pipe(map((apiResponse: HttpInfo) => apiResponse.data)); + } + /** * Get project list * @param [userId] diff --git a/src/types/PromiseAPI.ts b/src/types/PromiseAPI.ts index f9c3227..ff78c48 100755 --- a/src/types/PromiseAPI.ts +++ b/src/types/PromiseAPI.ts @@ -1591,6 +1591,24 @@ export class PromiseWebApi { return result.toPromise(); } + /** + * Get project details + * @param projectId + */ + public getProjectByIdWithHttpInfo(projectId: string, _options?: Configuration): Promise> { + const result = this.api.getProjectByIdWithHttpInfo(projectId, _options); + return result.toPromise(); + } + + /** + * Get project details + * @param projectId + */ + public getProjectById(projectId: string, _options?: Configuration): Promise { + const result = this.api.getProjectById(projectId, _options); + return result.toPromise(); + } + /** * Get project list * @param [userId]