Pārlūkot izejas kodu

openapi core update

master
Florian Eisenmenger pirms 2 gadiem
vecāks
revīzija
11a5504170
12 mainītis faili ar 1047 papildinājumiem un 5 dzēšanām
  1. +1
    -1
      matsen-tool/openapi.json
  2. +370
    -3
      matsen-tool/openapi.yaml
  3. +25
    -0
      matsen-tool/src/app/_forms/apiForms.ts
  4. +6
    -0
      matsen-tool/src/app/core/api/v1/.openapi-generator/FILES
  5. +3
    -1
      matsen-tool/src/app/core/api/v1/api/api.ts
  6. +514
    -0
      matsen-tool/src/app/core/api/v1/api/product.service.ts
  7. +23
    -0
      matsen-tool/src/app/core/api/v1/model/apiProductsGetCollection200Response.ts
  8. +22
    -0
      matsen-tool/src/app/core/api/v1/model/apiProductsGetCollection200Response1.ts
  9. +5
    -0
      matsen-tool/src/app/core/api/v1/model/models.ts
  10. +24
    -0
      matsen-tool/src/app/core/api/v1/model/product.ts
  11. +26
    -0
      matsen-tool/src/app/core/api/v1/model/productJsonhal.ts
  12. +28
    -0
      matsen-tool/src/app/core/api/v1/model/productJsonld.ts

+ 1
- 1
matsen-tool/openapi.json
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 370
- 3
matsen-tool/openapi.yaml Parādīt failu

@@ -1267,6 +1267,254 @@ paths:
required: true
deprecated: false
parameters: []
/api/products:
get:
operationId: api_products_get_collection
tags:
- Product
responses:
200:
description: 'Product collection'
content:
application/ld+json:
schema:
type: object
properties:
'hydra:member': { type: array, items: { $ref: '#/components/schemas/Product.jsonld' } }
'hydra:totalItems': { type: integer, minimum: 0 }
'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } }
'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } }
required:
- 'hydra:member'
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Product'
text/html:
schema:
type: array
items:
$ref: '#/components/schemas/Product'
application/hal+json:
schema:
type: object
properties:
_embedded: { type: array, items: { $ref: '#/components/schemas/Product.jsonhal' } }
totalItems: { type: integer, minimum: 0 }
itemsPerPage: { type: integer, minimum: 0 }
_links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
required:
- _links
- _embedded
summary: 'Retrieves the collection of Product resources.'
description: 'Retrieves the collection of Product resources.'
parameters:
-
name: page
in: query
description: 'The collection page number'
required: false
deprecated: false
allowEmptyValue: true
schema:
type: integer
default: 1
style: form
explode: false
allowReserved: false
-
name: itemsPerPage
in: query
description: 'The number of items per page'
required: false
deprecated: false
allowEmptyValue: true
schema:
type: integer
default: 10
minimum: 0
maximum: 50
style: form
explode: false
allowReserved: false
-
name: 'order[name]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
enum:
- asc
- desc
style: form
explode: false
allowReserved: false
deprecated: false
post:
operationId: api_products_post
tags:
- Product
responses:
201:
description: 'Product resource created'
content:
application/ld+json:
schema:
$ref: '#/components/schemas/Product.jsonld'
application/json:
schema:
$ref: '#/components/schemas/Product'
text/html:
schema:
$ref: '#/components/schemas/Product'
application/hal+json:
schema:
$ref: '#/components/schemas/Product.jsonhal'
links: { }
400:
description: 'Invalid input'
422:
description: 'Unprocessable entity'
summary: 'Creates a Product resource.'
description: 'Creates a Product resource.'
parameters: []
requestBody:
description: 'The new Product resource'
content:
application/ld+json:
schema:
$ref: '#/components/schemas/Product.jsonld'
application/json:
schema:
$ref: '#/components/schemas/Product'
text/html:
schema:
$ref: '#/components/schemas/Product'
application/hal+json:
schema:
$ref: '#/components/schemas/Product.jsonhal'
required: true
deprecated: false
parameters: []
'/api/products/{id}':
get:
operationId: api_products_id_get
tags:
- Product
responses:
200:
description: 'Product resource'
content:
application/ld+json:
schema:
$ref: '#/components/schemas/Product.jsonld'
application/json:
schema:
$ref: '#/components/schemas/Product'
text/html:
schema:
$ref: '#/components/schemas/Product'
application/hal+json:
schema:
$ref: '#/components/schemas/Product.jsonhal'
404:
description: 'Resource not found'
summary: 'Retrieves a Product resource.'
description: 'Retrieves a Product resource.'
parameters:
-
name: id
in: path
description: 'ProductApi identifier'
required: true
deprecated: false
allowEmptyValue: false
schema:
type: string
style: simple
explode: false
allowReserved: false
deprecated: false
delete:
operationId: api_products_id_delete
tags:
- Product
responses:
204:
description: 'Product resource deleted'
404:
description: 'Resource not found'
summary: 'Removes the Product resource.'
description: 'Removes the Product resource.'
parameters:
-
name: id
in: path
description: 'ProductApi identifier'
required: true
deprecated: false
allowEmptyValue: false
schema:
type: string
style: simple
explode: false
allowReserved: false
deprecated: false
patch:
operationId: api_products_id_patch
tags:
- Product
responses:
200:
description: 'Product resource updated'
content:
application/ld+json:
schema:
$ref: '#/components/schemas/Product.jsonld'
application/json:
schema:
$ref: '#/components/schemas/Product'
text/html:
schema:
$ref: '#/components/schemas/Product'
application/hal+json:
schema:
$ref: '#/components/schemas/Product.jsonhal'
links: { }
400:
description: 'Invalid input'
422:
description: 'Unprocessable entity'
404:
description: 'Resource not found'
summary: 'Updates the Product resource.'
description: 'Updates the Product resource.'
parameters:
-
name: id
in: path
description: 'ProductApi identifier'
required: true
deprecated: false
allowEmptyValue: false
schema:
type: string
style: simple
explode: false
allowReserved: false
requestBody:
description: 'The updated Product resource'
content:
application/merge-patch+json:
schema:
$ref: '#/components/schemas/Product'
required: true
deprecated: false
parameters: []
/api/users:
get:
operationId: api_users_get_collection
@@ -1684,7 +1932,6 @@ components:
type:
- string
- 'null'
format: date-time
image:
'owl:maxCardinality': 1
type:
@@ -1762,7 +2009,6 @@ components:
type:
- string
- 'null'
format: date-time
image:
'owl:maxCardinality': 1
type:
@@ -1854,7 +2100,6 @@ components:
type:
- string
- 'null'
format: date-time
image:
'owl:maxCardinality': 1
type:
@@ -2499,6 +2744,128 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
Product:
type: object
description: ''
deprecated: false
required:
- name
properties:
name:
type: string
description:
type:
- string
- 'null'
image:
'owl:maxCardinality': 1
type:
- string
- 'null'
format: iri-reference
example: 'https://example.com/'
imageUrl:
readOnly: true
type:
- string
- 'null'
createdAt:
type:
- string
- 'null'
format: date-time
Product.jsonhal:
type: object
description: ''
deprecated: false
required:
- name
properties:
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
format: iri-reference
name:
type: string
description:
type:
- string
- 'null'
image:
'owl:maxCardinality': 1
type:
- string
- 'null'
format: iri-reference
example: 'https://example.com/'
imageUrl:
readOnly: true
type:
- string
- 'null'
createdAt:
type:
- string
- 'null'
format: date-time
Product.jsonld:
type: object
description: ''
deprecated: false
required:
- name
properties:
'@context':
readOnly: true
oneOf:
-
type: string
-
type: object
properties:
'@vocab':
type: string
hydra:
type: string
enum: ['http://www.w3.org/ns/hydra/core#']
required:
- '@vocab'
- hydra
additionalProperties: true
'@id':
readOnly: true
type: string
'@type':
readOnly: true
type: string
name:
type: string
description:
type:
- string
- 'null'
image:
'owl:maxCardinality': 1
type:
- string
- 'null'
format: iri-reference
example: 'https://example.com/'
imageUrl:
readOnly: true
type:
- string
- 'null'
createdAt:
type:
- string
- 'null'
format: date-time
User:
type: object
description: ''


+ 25
- 0
matsen-tool/src/app/_forms/apiForms.ts Parādīt failu

@@ -188,6 +188,31 @@ export const postJsonldPostingCreateForm = new FormGroup({
contact: new FormControl(null, [])
});

export const productForm = new FormGroup({
name: new FormControl(null, [Validators.required]),
description: new FormControl(null, []),
image: new FormControl(null, []),
imageUrl: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

export const productJsonhalForm = new FormGroup({
_links: new FormControl(null, []),
name: new FormControl(null, [Validators.required]),
description: new FormControl(null, []),
image: new FormControl(null, []),
imageUrl: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

export const productJsonldForm = new FormGroup({
name: new FormControl(null, [Validators.required]),
description: new FormControl(null, []),
image: new FormControl(null, []),
imageUrl: new FormControl(null, []),
createdAt: new FormControl(null, [])
});

export const userForm = new FormGroup({
email: new FormControl(null, [Validators.required, Validators.email]),
firstName: new FormControl(null, [Validators.required]),


+ 6
- 0
matsen-tool/src/app/core/api/v1/.openapi-generator/FILES Parādīt failu

@@ -8,6 +8,7 @@ api/loginCheck.service.ts
api/media.service.ts
api/partner.service.ts
api/post.service.ts
api/product.service.ts
api/user.service.ts
configuration.ts
encoder.ts
@@ -28,6 +29,8 @@ model/apiPartnersGetCollection200Response.ts
model/apiPartnersGetCollection200Response1.ts
model/apiPostsGetCollection200Response.ts
model/apiPostsGetCollection200Response1.ts
model/apiProductsGetCollection200Response.ts
model/apiProductsGetCollection200Response1.ts
model/apiUsersGetCollection200Response.ts
model/apiUsersGetCollection200Response1.ts
model/comment.ts
@@ -55,6 +58,9 @@ model/postJsonld.ts
model/postJsonldPostingCreate.ts
model/postPostingCreate.ts
model/postPostingPatch.ts
model/product.ts
model/productJsonhal.ts
model/productJsonld.ts
model/user.ts
model/userJsonhal.ts
model/userJsonld.ts


+ 3
- 1
matsen-tool/src/app/core/api/v1/api/api.ts Parādīt failu

@@ -10,6 +10,8 @@ export * from './partner.service';
import { PartnerService } from './partner.service';
export * from './post.service';
import { PostService } from './post.service';
export * from './product.service';
import { ProductService } from './product.service';
export * from './user.service';
import { UserService } from './user.service';
export const APIS = [CommentService, ContactService, LoginCheckService, MediaService, PartnerService, PostService, UserService];
export const APIS = [CommentService, ContactService, LoginCheckService, MediaService, PartnerService, PostService, ProductService, UserService];

+ 514
- 0
matsen-tool/src/app/core/api/v1/api/product.service.ts Parādīt failu

@@ -0,0 +1,514 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */

import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';

// @ts-ignore
import { ApiProductsGetCollection200Response } from '../model/apiProductsGetCollection200Response';
// @ts-ignore
import { ApiProductsGetCollection200Response1 } from '../model/apiProductsGetCollection200Response1';
// @ts-ignore
import { Product } from '../model/product';
// @ts-ignore
import { ProductJsonhal } from '../model/productJsonhal';
// @ts-ignore
import { ProductJsonld } from '../model/productJsonld';

// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';



@Injectable({
providedIn: 'root'
})
export class ProductService {

protected basePath = 'http://localhost';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();
public encoder: HttpParameterCodec;

constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) {
if (configuration) {
this.configuration = configuration;
}
if (typeof this.configuration.basePath !== 'string') {
if (Array.isArray(basePath) && basePath.length > 0) {
basePath = basePath[0];
}

if (typeof basePath !== 'string') {
basePath = this.basePath;
}
this.configuration.basePath = basePath;
}
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}


// @ts-ignore
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
if (typeof value === "object" && value instanceof Date === false) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
} else {
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
}
return httpParams;
}

private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams {
if (value == null) {
return httpParams;
}

if (typeof value === "object") {
if (Array.isArray(value)) {
(value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
} else if (value instanceof Date) {
if (key != null) {
httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10));
} else {
throw Error("key may not be null if value is Date");
}
} else {
Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive(
httpParams, value[k], key != null ? `${key}.${k}` : k));
}
} else if (key != null) {
httpParams = httpParams.append(key, value);
} else {
throw Error("key may not be null if value is not object or array");
}
return httpParams;
}

/**
* Retrieves the collection of Product resources.
* Retrieves the collection of Product resources.
* @param page The collection page number
* @param itemsPerPage The number of items per page
* @param orderName
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ApiProductsGetCollection200Response>;
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ApiProductsGetCollection200Response>>;
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ApiProductsGetCollection200Response>>;
public productsGetCollection(page?: number, itemsPerPage?: number, orderName?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {

let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (page !== undefined && page !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
}
if (itemsPerPage !== undefined && itemsPerPage !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>itemsPerPage, 'itemsPerPage');
}
if (orderName !== undefined && orderName !== null) {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>orderName, 'order[name]');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/products`;
return this.httpClient.request<ApiProductsGetCollection200Response>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Removes the Product resource.
* Removes the Product resource.
* @param id ProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public productsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public productsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public productsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public productsIdDelete(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling productsIdDelete.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Retrieves a Product resource.
* Retrieves a Product resource.
* @param id ProductApi identifier
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public productsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ProductJsonld>;
public productsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ProductJsonld>>;
public productsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ProductJsonld>>;
public productsIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling productsIdGet.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<ProductJsonld>('get', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Updates the Product resource.
* Updates the Product resource.
* @param id ProductApi identifier
* @param product The updated Product resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public productsIdPatch(id: string, product: Product, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ProductJsonld>;
public productsIdPatch(id: string, product: Product, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ProductJsonld>>;
public productsIdPatch(id: string, product: Product, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ProductJsonld>>;
public productsIdPatch(id: string, product: Product, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling productsIdPatch.');
}
if (product === null || product === undefined) {
throw new Error('Required parameter product was null or undefined when calling productsIdPatch.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


// to determine the Content-Type header
const consumes: string[] = [
'application/merge-patch+json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}

let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<ProductJsonld>('patch', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: product,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

/**
* Creates a Product resource.
* Creates a Product resource.
* @param productJsonld The new Product resource
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public productsPost(productJsonld: ProductJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<ProductJsonld>;
public productsPost(productJsonld: ProductJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ProductJsonld>>;
public productsPost(productJsonld: ProductJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ProductJsonld>>;
public productsPost(productJsonld: ProductJsonld, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (productJsonld === null || productJsonld === undefined) {
throw new Error('Required parameter productJsonld was null or undefined when calling productsPost.');
}

let localVarHeaders = this.defaultHeaders;

let localVarCredential: string | undefined;
// authentication (JWT) required
localVarCredential = this.configuration.lookupCredential('JWT');
if (localVarCredential) {
localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
}

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}

let localVarTransferCache: boolean | undefined = options && options.transferCache;
if (localVarTransferCache === undefined) {
localVarTransferCache = true;
}


// to determine the Content-Type header
const consumes: string[] = [
'application/ld+json',
'application/json',
'text/html',
'application/hal+json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}

let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

let localVarPath = `/api/products`;
return this.httpClient.request<ProductJsonld>('post', `${this.configuration.basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: productJsonld,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
reportProgress: reportProgress
}
);
}

}

+ 23
- 0
matsen-tool/src/app/core/api/v1/model/apiProductsGetCollection200Response.ts Parādīt failu

@@ -0,0 +1,23 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { ApiCommentsGetCollection200ResponseHydraSearch } from './apiCommentsGetCollection200ResponseHydraSearch';
import { ProductJsonld } from './productJsonld';
import { ApiCommentsGetCollection200ResponseHydraView } from './apiCommentsGetCollection200ResponseHydraView';


export interface ApiProductsGetCollection200Response {
'hydra:member': Array<ProductJsonld>;
'hydra:totalItems'?: number;
'hydra:view'?: ApiCommentsGetCollection200ResponseHydraView;
'hydra:search'?: ApiCommentsGetCollection200ResponseHydraSearch;
}


+ 22
- 0
matsen-tool/src/app/core/api/v1/model/apiProductsGetCollection200Response1.ts Parādīt failu

@@ -0,0 +1,22 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { ProductJsonhal } from './productJsonhal';
import { ApiCommentsGetCollection200Response1Links } from './apiCommentsGetCollection200Response1Links';


export interface ApiProductsGetCollection200Response1 {
_embedded: Array<ProductJsonhal>;
totalItems?: number;
itemsPerPage?: number;
_links: ApiCommentsGetCollection200Response1Links;
}


+ 5
- 0
matsen-tool/src/app/core/api/v1/model/models.ts Parādīt failu

@@ -13,6 +13,8 @@ export * from './apiPartnersGetCollection200Response';
export * from './apiPartnersGetCollection200Response1';
export * from './apiPostsGetCollection200Response';
export * from './apiPostsGetCollection200Response1';
export * from './apiProductsGetCollection200Response';
export * from './apiProductsGetCollection200Response1';
export * from './apiUsersGetCollection200Response';
export * from './apiUsersGetCollection200Response1';
export * from './comment';
@@ -39,6 +41,9 @@ export * from './postJsonld';
export * from './postJsonldPostingCreate';
export * from './postPostingCreate';
export * from './postPostingPatch';
export * from './product';
export * from './productJsonhal';
export * from './productJsonld';
export * from './user';
export * from './userJsonhal';
export * from './userJsonld';

+ 24
- 0
matsen-tool/src/app/core/api/v1/model/product.ts Parādīt failu

@@ -0,0 +1,24 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


/**
*
*/
export interface Product {
name: string;
description?: string | null;
image?: string | null;
readonly imageUrl?: string | null;
createdAt?: string | null;
}


+ 26
- 0
matsen-tool/src/app/core/api/v1/model/productJsonhal.ts Parādīt failu

@@ -0,0 +1,26 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CommentJsonhalLinks } from './commentJsonhalLinks';


/**
*
*/
export interface ProductJsonhal {
_links?: CommentJsonhalLinks;
name: string;
description?: string | null;
image?: string | null;
readonly imageUrl?: string | null;
createdAt?: string | null;
}


+ 28
- 0
matsen-tool/src/app/core/api/v1/model/productJsonld.ts Parādīt failu

@@ -0,0 +1,28 @@
/**
* Matsen API Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CommentJsonldContext } from './commentJsonldContext';


/**
*
*/
export interface ProductJsonld {
context?: CommentJsonldContext;
readonly id?: string;
readonly type?: string;
name: string;
description?: string | null;
image?: string | null;
readonly imageUrl?: string | null;
createdAt?: string | null;
}


Notiek ielāde…
Atcelt
Saglabāt