Skip to content

Commit 9f4ad8f

Browse files
chore: generated code for commit 859c0a9. [skip ci]
Co-authored-by: Mehmet Ali Gok <[email protected]>
1 parent 859c0a9 commit 9f4ad8f

File tree

9 files changed

+90
-10
lines changed

9 files changed

+90
-10
lines changed

clients/algoliasearch-client-javascript/packages/ingestion/model/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export * from './sourceJson';
5858
export * from './sourceSearch';
5959
export * from './sourceType';
6060
export * from './sourceUpdate';
61+
export * from './sourceUpdateCommercetools';
62+
export * from './sourceUpdateInput';
63+
export * from './sourceUpdateJson';
6164
export * from './sourceUpdateResponse';
6265
export * from './task';
6366
export * from './taskCreate';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
22

33
export type SourceBigCommerce = {
4+
/**
5+
* The store hash identifying the store the shopper is signing in to.
6+
*/
47
storeHash?: string;
58
};

clients/algoliasearch-client-javascript/packages/ingestion/model/sourceJson.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import type { MethodType } from './methodType';
44

55
export type SourceJson = {
6+
/**
7+
* The URL of the file.
8+
*/
69
url: string;
710

811
method?: MethodType;
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
22

3-
import type { SourceInput } from './sourceInput';
4-
import type { SourceType } from './sourceType';
3+
import type { SourceUpdateInput } from './sourceUpdateInput';
54

65
export type SourceUpdate = {
7-
type?: SourceType;
8-
96
name?: string;
107

11-
input?: SourceInput;
8+
input?: SourceUpdateInput;
129

1310
authenticationID?: string;
1411
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
export type SourceUpdateCommercetools = {
4+
/**
5+
* Unique and immutable key of the referenced Store.
6+
*/
7+
storeKeys?: string[];
8+
9+
/**
10+
* Array of locales that must match the following pattern: ^[a-z]{2}(-[A-Z]{2})?$. For example [\"fr-FR\", \"en\"].
11+
*/
12+
locales?: string[];
13+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { SourceUpdateCommercetools } from './sourceUpdateCommercetools';
4+
import type { SourceUpdateJson } from './sourceUpdateJson';
5+
6+
export type SourceUpdateInput = SourceUpdateCommercetools | SourceUpdateJson;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
2+
3+
import type { MethodType } from './methodType';
4+
5+
export type SourceUpdateJson = {
6+
/**
7+
* The URL of the file.
8+
*/
9+
url: string;
10+
11+
method?: MethodType;
12+
};

clients/algoliasearch-client-javascript/packages/ingestion/src/ingestionClient.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ export function createIngestionClient({
231231
);
232232
}
233233

234+
if (!sourceCreate.type) {
235+
throw new Error(
236+
'Parameter `sourceCreate.type` is required when calling `createSource`.'
237+
);
238+
}
239+
if (!sourceCreate.input) {
240+
throw new Error(
241+
'Parameter `sourceCreate.input` is required when calling `createSource`.'
242+
);
243+
}
244+
234245
const requestPath = '/1/sources';
235246
const headers: Headers = {};
236247
const queryParameters: QueryParameters = {};
@@ -1347,7 +1358,7 @@ export function createIngestionClient({
13471358
const queryParameters: QueryParameters = {};
13481359

13491360
const request: Request = {
1350-
method: 'POST',
1361+
method: 'PUT',
13511362
path: requestPath,
13521363
queryParameters,
13531364
headers,

specs/bundled/ingestion.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ components:
576576
storeKeys:
577577
type: array
578578
items:
579+
description: Unique and immutable key of the referenced Store.
579580
type: string
580581
locales:
581582
type: array
@@ -597,6 +598,7 @@ components:
597598
properties:
598599
storeHash:
599600
type: string
601+
description: The store hash identifying the store the shopper is signing in to.
600602
required:
601603
- store_hash
602604
MethodType:
@@ -610,6 +612,7 @@ components:
610612
properties:
611613
url:
612614
type: string
615+
description: The URL of the file.
613616
method:
614617
$ref: '#/components/schemas/MethodType'
615618
required:
@@ -684,16 +687,45 @@ components:
684687
type: string
685688
required:
686689
- sourceIDs
690+
SourceUpdateCommercetools:
691+
type: object
692+
additionalProperties: false
693+
properties:
694+
storeKeys:
695+
type: array
696+
description: Unique and immutable key of the referenced Store.
697+
items:
698+
type: string
699+
locales:
700+
type: array
701+
description: >
702+
Array of locales that must match the following pattern:
703+
^[a-z]{2}(-[A-Z]{2})?$. For example ["fr-FR", "en"].
704+
items:
705+
type: string
706+
SourceUpdateJson:
707+
type: object
708+
additionalProperties: false
709+
properties:
710+
url:
711+
type: string
712+
description: The URL of the file.
713+
method:
714+
$ref: '#/components/schemas/MethodType'
715+
required:
716+
- url
717+
SourceUpdateInput:
718+
oneOf:
719+
- $ref: '#/components/schemas/SourceUpdateCommercetools'
720+
- $ref: '#/components/schemas/SourceUpdateJson'
687721
SourceUpdate:
688722
type: object
689723
additionalProperties: false
690724
properties:
691-
type:
692-
$ref: '#/components/schemas/SourceType'
693725
name:
694726
type: string
695727
input:
696-
$ref: '#/components/schemas/SourceInput'
728+
$ref: '#/components/schemas/SourceUpdateInput'
697729
authenticationID:
698730
type: string
699731
SourceUpdateResponse:
@@ -1377,7 +1409,7 @@ paths:
13771409
$ref: '#/components/schemas/Source'
13781410
'400':
13791411
$ref: '#/components/responses/BadRequest'
1380-
post:
1412+
put:
13811413
tags:
13821414
- ingestion
13831415
summary: Update a source.

0 commit comments

Comments
 (0)