-
Notifications
You must be signed in to change notification settings - Fork 35
/
CreateIndexRequest.ts
111 lines (98 loc) · 3.18 KB
/
CreateIndexRequest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* tslint:disable */
/* eslint-disable */
/**
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: v1
* Contact: support@pinecone.io
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { CreateIndexRequestSpec } from './CreateIndexRequestSpec';
import {
CreateIndexRequestSpecFromJSON,
CreateIndexRequestSpecFromJSONTyped,
CreateIndexRequestSpecToJSON,
} from './CreateIndexRequestSpec';
/**
* The configuration needed to create a Pinecone index.
* @export
* @interface CreateIndexRequest
*/
export interface CreateIndexRequest {
/**
* The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'.
* @type {string}
* @memberof CreateIndexRequest
*/
name: string;
/**
* The dimensions of the vectors to be inserted in the index.
* @type {number}
* @memberof CreateIndexRequest
*/
dimension: number;
/**
* The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.
* @type {string}
* @memberof CreateIndexRequest
*/
metric?: CreateIndexRequestMetricEnum;
/**
*
* @type {CreateIndexRequestSpec}
* @memberof CreateIndexRequest
*/
spec: CreateIndexRequestSpec | null;
}
/**
* @export
*/
export const CreateIndexRequestMetricEnum = {
Cosine: 'cosine',
Euclidean: 'euclidean',
Dotproduct: 'dotproduct'
} as const;
export type CreateIndexRequestMetricEnum = typeof CreateIndexRequestMetricEnum[keyof typeof CreateIndexRequestMetricEnum];
/**
* Check if a given object implements the CreateIndexRequest interface.
*/
export function instanceOfCreateIndexRequest(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "dimension" in value;
isInstance = isInstance && "spec" in value;
return isInstance;
}
export function CreateIndexRequestFromJSON(json: any): CreateIndexRequest {
return CreateIndexRequestFromJSONTyped(json, false);
}
export function CreateIndexRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateIndexRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'dimension': json['dimension'],
'metric': !exists(json, 'metric') ? undefined : json['metric'],
'spec': CreateIndexRequestSpecFromJSON(json['spec']),
};
}
export function CreateIndexRequestToJSON(value?: CreateIndexRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'dimension': value.dimension,
'metric': value.metric,
'spec': CreateIndexRequestSpecToJSON(value.spec),
};
}