diff --git a/compiler/src/model/build-model.ts b/compiler/src/model/build-model.ts index cd5e2deb60..625c0c603f 100644 --- a/compiler/src/model/build-model.ts +++ b/compiler/src/model/build-model.ts @@ -267,14 +267,14 @@ function compileClassOrInterfaceDeclaration (declaration: ClassDeclaration | Int const queryType = type.query.find(property => property != null && property.name === part.name) as model.Property if (!deepEqual(queryType.type, part.type)) { assert(pathMember as Node, part.codegenName != null, `'${part.name}' already exist in the query_parameters with a different type, you should define an @codegen_name.`) - assert(pathMember as Node, !type.query.map(p => p.name).includes(part.codegenName), `The codegen_name '${part.codegenName}' already exists as parameter in query_parameters.`) + assert(pathMember as Node, !type.query.map(p => p.codegenName ?? p.name).includes(part.codegenName), `The codegen_name '${part.codegenName}' already exists as parameter in query_parameters.`) } } if (bodyProperties.map(p => p.name).includes(part.name)) { const bodyType = bodyProperties.find(property => property != null && property.name === part.name) as model.Property if (!deepEqual(bodyType.type, part.type)) { assert(pathMember as Node, part.codegenName != null, `'${part.name}' already exist in the body with a different type, you should define an @codegen_name.`) - assert(pathMember as Node, !bodyProperties.map(p => p.name).includes(part.codegenName), `The codegen_name '${part.codegenName}' already exists as parameter in body.`) + assert(pathMember as Node, !bodyProperties.map(p => p.codegenName ?? p.name).includes(part.codegenName), `The codegen_name '${part.codegenName}' already exists as parameter in body.`) } } } @@ -293,7 +293,7 @@ function compileClassOrInterfaceDeclaration (declaration: ClassDeclaration | Int ) assert( (bodyMember as PropertySignature).getJsDocs(), - !type.path.map(p => p.name).concat(type.query.map(p => p.name)).includes(tags.codegen_name), + !type.path.map(p => p.codegenName ?? p.name).concat(type.query.map(p => p.codegenName ?? p.name)).includes(tags.codegen_name), `The codegen_name '${tags.codegen_name}' already exists as a property in the path or query.` ) type.body = { diff --git a/output/schema/schema.json b/output/schema/schema.json index 0eb101b733..e4d2077c7b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -151632,6 +151632,112 @@ }, "specLocation": "slm/stop/StopSnapshotLifecycleManagementResponse.ts#L22-L22" }, + { + "inherits": { + "type": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "AzureRepository", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "azure" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "AzureRepositorySettings", + "namespace": "snapshot._types" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L40-L43" + }, + { + "inherits": { + "type": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "AzureRepositorySettings", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "client", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "container", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "base_path", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "readonly", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "location_mode", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L77-L83" + }, { "kind": "interface", "name": { @@ -151664,6 +151770,112 @@ ], "specLocation": "snapshot/_types/FileCountSnapshotStats.ts#L22-L25" }, + { + "inherits": { + "type": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "GcsRepository", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "gcs" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "GcsRepositorySettings", + "namespace": "snapshot._types" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L45-L48" + }, + { + "inherits": { + "type": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "GcsRepositorySettings", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "bucket", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "client", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "base_path", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "readonly", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "application_name", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L85-L91" + }, { "kind": "interface", "name": { @@ -151751,15 +151963,89 @@ "specLocation": "snapshot/_types/SnapshotInfoFeatureState.ts#L22-L25" }, { + "inherits": { + "type": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + } + }, "kind": "interface", "name": { - "name": "Repository", + "name": "ReadOnlyUrlRepository", "namespace": "snapshot._types" }, "properties": [ { "name": "type", "required": true, + "type": { + "kind": "literal_value", + "value": "url" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ReadOnlyUrlRepositorySettings", + "namespace": "snapshot._types" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L60-L63" + }, + { + "inherits": { + "type": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "ReadOnlyUrlRepositorySettings", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "http_max_retries", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "http_socket_timeout", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Time", + "namespace": "_types" + } + } + }, + { + "name": "max_number_of_snapshots", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "url", + "required": true, "type": { "kind": "instance_of", "type": { @@ -151767,7 +152053,77 @@ "namespace": "_builtins" } } - }, + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L110-L115" + }, + { + "kind": "type_alias", + "name": { + "name": "Repository", + "namespace": "snapshot._types" + }, + "specLocation": "snapshot/_types/SnapshotRepository.ts#L24-L34", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "AzureRepository", + "namespace": "snapshot._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "GcsRepository", + "namespace": "snapshot._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "S3Repository", + "namespace": "snapshot._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "SharedFileSystemRepository", + "namespace": "snapshot._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "ReadOnlyUrlRepository", + "namespace": "snapshot._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "SourceOnlyRepository", + "namespace": "snapshot._types" + } + } + ], + "kind": "union_of" + }, + "variants": { + "kind": "internal_tag", + "nonExhaustive": true, + "tag": "type" + } + }, + { + "kind": "interface", + "name": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + }, + "properties": [ { "name": "uuid", "required": false, @@ -151778,6 +152134,84 @@ "namespace": "_types" } } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L36-L38" + }, + { + "kind": "interface", + "name": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "chunk_size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ByteSize", + "namespace": "_types" + } + } + }, + { + "name": "compress", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "max_restore_bytes_per_sec", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ByteSize", + "namespace": "_types" + } + } + }, + { + "name": "max_snapshot_bytes_per_sec", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ByteSize", + "namespace": "_types" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L70-L75" + }, + { + "inherits": { + "type": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "S3Repository", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "s3" + } }, { "name": "settings", @@ -151785,23 +152219,40 @@ "type": { "kind": "instance_of", "type": { - "name": "RepositorySettings", + "name": "S3RepositorySettings", "namespace": "snapshot._types" } } } ], - "specLocation": "snapshot/_types/SnapshotRepository.ts#L23-L27" + "specLocation": "snapshot/_types/SnapshotRepository.ts#L50-L53" }, { + "inherits": { + "type": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + } + }, "kind": "interface", "name": { - "name": "RepositorySettings", + "name": "S3RepositorySettings", "namespace": "snapshot._types" }, "properties": [ { - "name": "chunk_size", + "name": "bucket", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "client", "required": false, "type": { "kind": "instance_of", @@ -151812,54 +152263,52 @@ } }, { - "name": "compress", + "name": "base_path", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "readonly", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } } }, { - "name": "concurrent_streams", + "name": "server_side_encryption", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } } }, { - "name": "location", - "required": true, + "name": "buffer_size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ByteSize", + "namespace": "_types" + } + } + }, + { + "name": "canned_acl", + "required": false, "type": { "kind": "instance_of", "type": { @@ -151869,33 +152318,18 @@ } }, { - "aliases": [ - "readonly" - ], - "name": "read_only", + "name": "storage_class", "required": false, "type": { - "items": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - ], - "kind": "union_of" + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } } } ], - "specLocation": "snapshot/_types/SnapshotRepository.ts#L29-L38" + "specLocation": "snapshot/_types/SnapshotRepository.ts#L93-L102" }, { "kind": "interface", @@ -152089,6 +152523,90 @@ ], "specLocation": "snapshot/_types/SnapshotShardsStatus.ts#L35-L38" }, + { + "inherits": { + "type": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "SharedFileSystemRepository", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "fs" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SharedFileSystemRepositorySettings", + "namespace": "snapshot._types" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L55-L58" + }, + { + "inherits": { + "type": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "SharedFileSystemRepositorySettings", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "location", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "max_number_of_snapshots", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "readonly", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L104-L108" + }, { "kind": "interface", "name": { @@ -152594,6 +153112,93 @@ ], "specLocation": "snapshot/_types/SnapshotStats.ts#L23-L28" }, + { + "inherits": { + "type": { + "name": "RepositoryBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "SourceOnlyRepository", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "source" + } + }, + { + "name": "settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SourceOnlyRepositorySettings", + "namespace": "snapshot._types" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L65-L68" + }, + { + "inherits": { + "type": { + "name": "RepositorySettingsBase", + "namespace": "snapshot._types" + } + }, + "kind": "interface", + "name": { + "name": "SourceOnlyRepositorySettings", + "namespace": "snapshot._types" + }, + "properties": [ + { + "name": "delegate_type", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "max_number_of_snapshots", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "aliases": [ + "readonly" + ], + "name": "read_only", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "snapshot/_types/SnapshotRepository.ts#L117-L124" + }, { "kind": "interface", "name": { @@ -153139,42 +153744,15 @@ "CommonQueryParameters" ], "body": { - "kind": "properties", - "properties": [ - { - "name": "repository", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Repository", - "namespace": "snapshot._types" - } - } - }, - { - "name": "type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "settings", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "RepositorySettings", - "namespace": "snapshot._types" - } - } + "codegenName": "repository", + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "Repository", + "namespace": "snapshot._types" } - ] + } }, "description": "Creates a repository.", "inherits": { @@ -153241,7 +153819,7 @@ } } ], - "specLocation": "snapshot/create_repository/SnapshotCreateRepositoryRequest.ts#L28-L49" + "specLocation": "snapshot/create_repository/SnapshotCreateRepositoryRequest.ts#L25-L43" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b9d7c522f4..779f4d95f9 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -15251,11 +15251,37 @@ export interface SlmStopRequest extends RequestBase { export interface SlmStopResponse extends AcknowledgedResponseBase { } +export interface SnapshotAzureRepository extends SnapshotRepositoryBase { + type: 'azure' + settings: SnapshotAzureRepositorySettings +} + +export interface SnapshotAzureRepositorySettings extends SnapshotRepositorySettingsBase { + client?: string + container?: string + base_path?: string + readonly?: boolean + location_mode?: string +} + export interface SnapshotFileCountSnapshotStats { file_count: integer size_in_bytes: long } +export interface SnapshotGcsRepository extends SnapshotRepositoryBase { + type: 'gcs' + settings: SnapshotGcsRepositorySettings +} + +export interface SnapshotGcsRepositorySettings extends SnapshotRepositorySettingsBase { + bucket: string + client?: string + base_path?: string + readonly?: boolean + application_name?: string +} + export interface SnapshotIndexDetails { shard_count: integer size?: ByteSize @@ -15268,19 +15294,45 @@ export interface SnapshotInfoFeatureState { indices: Indices } -export interface SnapshotRepository { - type: string +export interface SnapshotReadOnlyUrlRepository extends SnapshotRepositoryBase { + type: 'url' + settings: SnapshotReadOnlyUrlRepositorySettings +} + +export interface SnapshotReadOnlyUrlRepositorySettings extends SnapshotRepositorySettingsBase { + http_max_retries?: integer + http_socket_timeout?: Time + max_number_of_snapshots?: integer + url: string +} + +export type SnapshotRepository = SnapshotAzureRepository | SnapshotGcsRepository | SnapshotS3Repository | SnapshotSharedFileSystemRepository | SnapshotReadOnlyUrlRepository | SnapshotSourceOnlyRepository + +export interface SnapshotRepositoryBase { uuid?: Uuid - settings: SnapshotRepositorySettings } -export interface SnapshotRepositorySettings { - chunk_size?: string - compress?: string | boolean - concurrent_streams?: string | integer - location: string - read_only?: string | boolean - readonly?: string | boolean +export interface SnapshotRepositorySettingsBase { + chunk_size?: ByteSize + compress?: boolean + max_restore_bytes_per_sec?: ByteSize + max_snapshot_bytes_per_sec?: ByteSize +} + +export interface SnapshotS3Repository extends SnapshotRepositoryBase { + type: 's3' + settings: SnapshotS3RepositorySettings +} + +export interface SnapshotS3RepositorySettings extends SnapshotRepositorySettingsBase { + bucket: string + client?: string + base_path?: string + readonly?: boolean + server_side_encryption?: boolean + buffer_size?: ByteSize + canned_acl?: string + storage_class?: string } export interface SnapshotShardsStats { @@ -15306,6 +15358,17 @@ export interface SnapshotShardsStatsSummaryItem { size_in_bytes: long } +export interface SnapshotSharedFileSystemRepository extends SnapshotRepositoryBase { + type: 'fs' + settings: SnapshotSharedFileSystemRepositorySettings +} + +export interface SnapshotSharedFileSystemRepositorySettings extends SnapshotRepositorySettingsBase { + location: string + max_number_of_snapshots?: integer + readonly?: boolean +} + export interface SnapshotSnapshotIndexStats { shards: Record shards_stats: SnapshotShardsStats @@ -15358,6 +15421,18 @@ export interface SnapshotSnapshotStats { total: SnapshotFileCountSnapshotStats } +export interface SnapshotSourceOnlyRepository extends SnapshotRepositoryBase { + type: 'source' + settings: SnapshotSourceOnlyRepositorySettings +} + +export interface SnapshotSourceOnlyRepositorySettings extends SnapshotRepositorySettingsBase { + delegate_type?: string + max_number_of_snapshots?: integer + read_only?: boolean + readonly?: boolean +} + export interface SnapshotStatus { include_global_state: boolean indices: Record @@ -15423,11 +15498,7 @@ export interface SnapshotCreateRepositoryRequest extends RequestBase { master_timeout?: Time timeout?: Time verify?: boolean - body?: { - repository?: SnapshotRepository - type: string - settings: SnapshotRepositorySettings - } + body?: SnapshotRepository } export interface SnapshotCreateRepositoryResponse extends AcknowledgedResponseBase { diff --git a/specification/snapshot/_types/SnapshotRepository.ts b/specification/snapshot/_types/SnapshotRepository.ts index 0692524f2e..4ecb8c1f02 100644 --- a/specification/snapshot/_types/SnapshotRepository.ts +++ b/specification/snapshot/_types/SnapshotRepository.ts @@ -17,22 +17,108 @@ * under the License. */ -import { Uuid } from '@_types/common' +import { ByteSize, Uuid } from '@_types/common' import { integer } from '@_types/Numeric' +import { Time } from '@_types/Time' -export class Repository { - type: string +/** + * @variants internal tag='type' + * @non_exhaustive + */ +export type Repository = + | AzureRepository + | GcsRepository + | S3Repository + | SharedFileSystemRepository + | ReadOnlyUrlRepository + | SourceOnlyRepository + +export class RepositoryBase { uuid?: Uuid - settings: RepositorySettings } -export class RepositorySettings { - chunk_size?: string - compress?: string | boolean - concurrent_streams?: string | integer +export class AzureRepository extends RepositoryBase { + type: 'azure' + settings: AzureRepositorySettings +} + +export class GcsRepository extends RepositoryBase { + type: 'gcs' + settings: GcsRepositorySettings +} + +export class S3Repository extends RepositoryBase { + type: 's3' + settings: S3RepositorySettings +} + +export class SharedFileSystemRepository extends RepositoryBase { + type: 'fs' + settings: SharedFileSystemRepositorySettings +} + +export class ReadOnlyUrlRepository extends RepositoryBase { + type: 'url' + settings: ReadOnlyUrlRepositorySettings +} + +export class SourceOnlyRepository extends RepositoryBase { + type: 'source' + settings: SourceOnlyRepositorySettings +} + +export class RepositorySettingsBase { + chunk_size?: ByteSize + compress?: boolean + max_restore_bytes_per_sec?: ByteSize + max_snapshot_bytes_per_sec?: ByteSize +} + +export class AzureRepositorySettings extends RepositorySettingsBase { + client?: string + container?: string + base_path?: string + readonly?: boolean + location_mode?: string +} + +export class GcsRepositorySettings extends RepositorySettingsBase { + bucket: string + client?: string + base_path?: string + readonly?: boolean + application_name?: string +} + +export class S3RepositorySettings extends RepositorySettingsBase { + bucket: string + client?: string + base_path?: string + readonly?: boolean + server_side_encryption?: boolean + buffer_size?: ByteSize + canned_acl?: string + storage_class?: string +} + +export class SharedFileSystemRepositorySettings extends RepositorySettingsBase { location: string + max_number_of_snapshots?: integer + readonly?: boolean +} + +export class ReadOnlyUrlRepositorySettings extends RepositorySettingsBase { + http_max_retries?: integer + http_socket_timeout?: Time + max_number_of_snapshots?: integer + url: string +} + +export class SourceOnlyRepositorySettings extends RepositorySettingsBase { + delegate_type?: string + max_number_of_snapshots?: integer /** * @aliases readonly */ - read_only?: string | boolean + read_only?: boolean } diff --git a/specification/snapshot/create_repository/SnapshotCreateRepositoryRequest.ts b/specification/snapshot/create_repository/SnapshotCreateRepositoryRequest.ts index 3687e13810..2f308907af 100644 --- a/specification/snapshot/create_repository/SnapshotCreateRepositoryRequest.ts +++ b/specification/snapshot/create_repository/SnapshotCreateRepositoryRequest.ts @@ -17,10 +17,7 @@ * under the License. */ -import { - Repository, - RepositorySettings -} from '@snapshot/_types/SnapshotRepository' +import { Repository } from '@snapshot/_types/SnapshotRepository' import { RequestBase } from '@_types/Base' import { Name } from '@_types/common' import { Time } from '@_types/Time' @@ -41,9 +38,6 @@ export interface Request extends RequestBase { timeout?: Time verify?: boolean } - body: { - repository?: Repository - type: string - settings: RepositorySettings - } + /** @codegen_name repository */ + body: Repository }