diff --git a/sdk/containerregistry/container-registry/package.json b/sdk/containerregistry/container-registry/package.json index 58e4c2a27d00..388b72549e28 100644 --- a/sdk/containerregistry/container-registry/package.json +++ b/sdk/containerregistry/container-registry/package.json @@ -15,11 +15,7 @@ "constantPaths": [ { "path": "src/generated/generatedClientContext.ts", - "prefix": "packageVersion" - }, - { - "path": "src/constants.ts", - "prefix": "SDK_VERSION" + "prefix": "const packageDetails" }, { "path": "swagger/README.md", diff --git a/sdk/containerregistry/container-registry/src/constants.ts b/sdk/containerregistry/container-registry/src/constants.ts deleted file mode 100644 index 3ec689ed2107..000000000000 --- a/sdk/containerregistry/container-registry/src/constants.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -export const SDK_VERSION: string = "1.0.0-beta.4"; diff --git a/sdk/containerregistry/container-registry/src/containerRegistryClient.ts b/sdk/containerregistry/container-registry/src/containerRegistryClient.ts index aa323f5395ac..d2a3f9a80eca 100644 --- a/sdk/containerregistry/container-registry/src/containerRegistryClient.ts +++ b/sdk/containerregistry/container-registry/src/containerRegistryClient.ts @@ -15,7 +15,6 @@ import { SpanStatusCode } from "@azure/core-tracing"; import "@azure/core-paging"; import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SDK_VERSION } from "./constants"; import { logger } from "./logger"; import { GeneratedClient } from "./generated"; import { createSpan } from "./tracing"; @@ -122,17 +121,6 @@ export class ContainerRegistryClient { options = credentialOrOptions ?? {}; } - // The below code helps us set a proper User-Agent header on all requests - const libInfo = `azsdk-js-container-registry/${SDK_VERSION}`; - if (!options.userAgentOptions) { - options.userAgentOptions = {}; - } - if (options.userAgentOptions.userAgentPrefix) { - options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`; - } else { - options.userAgentOptions.userAgentPrefix = libInfo; - } - const internalPipelineOptions: InternalPipelineOptions = { ...options, loggingOptions: { diff --git a/sdk/containerregistry/container-registry/src/generated/generatedClient.ts b/sdk/containerregistry/container-registry/src/generated/generatedClient.ts index 802392a69460..efe08bacd8e7 100644 --- a/sdk/containerregistry/container-registry/src/generated/generatedClient.ts +++ b/sdk/containerregistry/container-registry/src/generated/generatedClient.ts @@ -6,11 +6,16 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { + ContainerRegistryImpl, + ContainerRegistryBlobImpl, + AuthenticationImpl +} from "./operations"; import { ContainerRegistry, ContainerRegistryBlob, Authentication -} from "./operations"; +} from "./operationsInterfaces"; import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams } from "./models"; @@ -23,9 +28,9 @@ export class GeneratedClient extends GeneratedClientContext { */ constructor(url: string, options?: GeneratedClientOptionalParams) { super(url, options); - this.containerRegistry = new ContainerRegistry(this); - this.containerRegistryBlob = new ContainerRegistryBlob(this); - this.authentication = new Authentication(this); + this.containerRegistry = new ContainerRegistryImpl(this); + this.containerRegistryBlob = new ContainerRegistryBlobImpl(this); + this.authentication = new AuthenticationImpl(this); } containerRegistry: ContainerRegistry; diff --git a/sdk/containerregistry/container-registry/src/generated/generatedClientContext.ts b/sdk/containerregistry/container-registry/src/generated/generatedClientContext.ts index e23312f41401..d6a7b973d414 100644 --- a/sdk/containerregistry/container-registry/src/generated/generatedClientContext.ts +++ b/sdk/containerregistry/container-registry/src/generated/generatedClientContext.ts @@ -27,17 +27,24 @@ export class GeneratedClientContext extends coreClient.ServiceClient { if (!options) { options = {}; } - const defaults: GeneratedClientOptionalParams = { requestContentType: "application/json; charset=utf-8" }; + const packageDetails = `azsdk-js-container-registry/1.0.0-beta.4`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + const optionsWithDefaults = { ...defaults, ...options, + userAgentOptions: { + userAgentPrefix + }, baseUri: options.endpoint || "{url}" }; - super(optionsWithDefaults); // Parameter assignments this.url = url; diff --git a/sdk/containerregistry/container-registry/src/generated/index.ts b/sdk/containerregistry/container-registry/src/generated/index.ts index 3aebf3c9a56c..707d58f011e8 100644 --- a/sdk/containerregistry/container-registry/src/generated/index.ts +++ b/sdk/containerregistry/container-registry/src/generated/index.ts @@ -9,3 +9,4 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; export { GeneratedClientContext } from "./generatedClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/containerregistry/container-registry/src/generated/models/index.ts b/sdk/containerregistry/container-registry/src/generated/models/index.ts index 691193ab46eb..145d3de29f2b 100644 --- a/sdk/containerregistry/container-registry/src/generated/models/index.ts +++ b/sdk/containerregistry/container-registry/src/generated/models/index.ts @@ -7,7 +7,7 @@ */ import * as coreClient from "@azure/core-client"; -import * as coreHttps from "@azure/core-rest-pipeline"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; /** Acr error response describing why the operation failed */ export interface AcrErrors { @@ -230,12 +230,12 @@ export interface ManifestAttributesBase { * CPU architecture * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly architecture?: ArtifactArchitecture | null; + readonly architecture?: ArtifactArchitecture; /** * Operating system * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operatingSystem?: ArtifactOperatingSystem | null; + readonly operatingSystem?: ArtifactOperatingSystem; /** * List of artifacts that are referenced by this manifest list, with information about the platform each supports. This list will be empty if this is a leaf manifest and not a manifest list. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -331,12 +331,12 @@ export interface ArtifactManifestProperties { * CPU architecture * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly architecture?: ArtifactArchitecture | null; + readonly architecture?: ArtifactArchitecture; /** * Operating system * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly operatingSystem?: ArtifactOperatingSystem | null; + readonly operatingSystem?: ArtifactOperatingSystem; /** * List of artifacts that are referenced by this manifest list, with information about the platform each supports. This list will be empty if this is a leaf manifest and not a manifest list. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -468,7 +468,7 @@ export interface Descriptor { /** Specifies a list of URIs from which this object may be downloaded. */ urls?: string[]; /** Additional information provided through arbitrary metadata. */ - annotations?: Annotations | null; + annotations?: Annotations; } /** Additional information provided through arbitrary metadata. */ @@ -553,7 +553,7 @@ export type ManifestWrapper = Manifest & { /** (V2, OCI) List of V2 image layer information */ layers?: Descriptor[]; /** (OCI, OCIIndex) Additional metadata */ - annotations?: Annotations | null; + annotations?: Annotations; /** (V1) CPU architecture */ architecture?: string; /** (V1) Image name */ @@ -593,7 +593,7 @@ export type OCIManifest = Manifest & { /** List of V2 image layer information */ layers?: Descriptor[]; /** Additional information provided through arbitrary metadata. */ - annotations?: Annotations | null; + annotations?: Annotations; }; /** Returns the requested OCI index file */ @@ -601,7 +601,7 @@ export type OCIIndex = Manifest & { /** List of OCI image layer information */ manifests?: ManifestListAttributes[]; /** Additional information provided through arbitrary metadata. */ - annotations?: Annotations | null; + annotations?: Annotations; }; /** Returns the requested V1 manifest file */ @@ -773,7 +773,7 @@ export const enum KnownArtifactArchitecture { * Defines values for ArtifactArchitecture. \ * {@link KnownArtifactArchitecture} can be used interchangeably with ArtifactArchitecture, * this enum contains the known values that the service supports. - * ### Know values supported by the service + * ### Known values supported by the service * **386** \ * **amd64** \ * **arm** \ @@ -812,7 +812,7 @@ export const enum KnownArtifactOperatingSystem { * Defines values for ArtifactOperatingSystem. \ * {@link KnownArtifactOperatingSystem} can be used interchangeably with ArtifactOperatingSystem, * this enum contains the known values that the service supports. - * ### Know values supported by the service + * ### Known values supported by the service * **aix** \ * **android** \ * **darwin** \ @@ -836,6 +836,10 @@ export type ArtifactTagOrderBy = "none" | "timedesc" | "timeasc"; /** Defines values for ArtifactManifestOrderBy. */ export type ArtifactManifestOrderBy = "none" | "timedesc" | "timeasc"; +/** Optional parameters. */ +export interface ContainerRegistryCheckDockerV2SupportOptionalParams + extends coreClient.OperationOptions {} + /** Optional parameters. */ export interface ContainerRegistryGetManifestOptionalParams extends coreClient.OperationOptions { @@ -846,12 +850,20 @@ export interface ContainerRegistryGetManifestOptionalParams /** Contains response data for the getManifest operation. */ export type ContainerRegistryGetManifestResponse = Manifest; +/** Optional parameters. */ +export interface ContainerRegistryCreateManifestOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the createManifest operation. */ export type ContainerRegistryCreateManifestResponse = ContainerRegistryCreateManifestHeaders & { /** The parsed response body. */ body: any; }; +/** Optional parameters. */ +export interface ContainerRegistryDeleteManifestOptionalParams + extends coreClient.OperationOptions {} + /** Optional parameters. */ export interface ContainerRegistryGetRepositoriesOptionalParams extends coreClient.OperationOptions { @@ -865,9 +877,17 @@ export interface ContainerRegistryGetRepositoriesOptionalParams export type ContainerRegistryGetRepositoriesResponse = ContainerRegistryGetRepositoriesHeaders & Repositories; +/** Optional parameters. */ +export interface ContainerRegistryGetPropertiesOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getProperties operation. */ export type ContainerRegistryGetPropertiesResponse = ContainerRepositoryProperties; +/** Optional parameters. */ +export interface ContainerRegistryDeleteRepositoryOptionalParams + extends coreClient.OperationOptions {} + /** Optional parameters. */ export interface ContainerRegistryUpdatePropertiesOptionalParams extends coreClient.OperationOptions { @@ -895,6 +915,10 @@ export interface ContainerRegistryGetTagsOptionalParams export type ContainerRegistryGetTagsResponse = ContainerRegistryGetTagsHeaders & TagList; +/** Optional parameters. */ +export interface ContainerRegistryGetTagPropertiesOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getTagProperties operation. */ export type ContainerRegistryGetTagPropertiesResponse = ArtifactTagProperties; @@ -908,6 +932,10 @@ export interface ContainerRegistryUpdateTagAttributesOptionalParams /** Contains response data for the updateTagAttributes operation. */ export type ContainerRegistryUpdateTagAttributesResponse = ArtifactTagProperties; +/** Optional parameters. */ +export interface ContainerRegistryDeleteTagOptionalParams + extends coreClient.OperationOptions {} + /** Optional parameters. */ export interface ContainerRegistryGetManifestsOptionalParams extends coreClient.OperationOptions { @@ -923,6 +951,10 @@ export interface ContainerRegistryGetManifestsOptionalParams export type ContainerRegistryGetManifestsResponse = ContainerRegistryGetManifestsHeaders & AcrManifests; +/** Optional parameters. */ +export interface ContainerRegistryGetManifestPropertiesOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getManifestProperties operation. */ export type ContainerRegistryGetManifestPropertiesResponse = ArtifactManifestProperties; @@ -981,6 +1013,10 @@ export interface ContainerRegistryGetManifestsNextOptionalParams export type ContainerRegistryGetManifestsNextResponse = ContainerRegistryGetManifestsNextHeaders & AcrManifests; +/** Optional parameters. */ +export interface ContainerRegistryBlobGetBlobOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getBlob operation. */ export type ContainerRegistryBlobGetBlobResponse = ContainerRegistryBlobGetBlobHeaders & { /** @@ -999,9 +1035,17 @@ export type ContainerRegistryBlobGetBlobResponse = ContainerRegistryBlobGetBlobH readableStreamBody?: NodeJS.ReadableStream; }; +/** Optional parameters. */ +export interface ContainerRegistryBlobCheckBlobExistsOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the checkBlobExists operation. */ export type ContainerRegistryBlobCheckBlobExistsResponse = ContainerRegistryBlobCheckBlobExistsHeaders; +/** Optional parameters. */ +export interface ContainerRegistryBlobDeleteBlobOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the deleteBlob operation. */ export type ContainerRegistryBlobDeleteBlobResponse = ContainerRegistryBlobDeleteBlobHeaders & { /** @@ -1020,12 +1064,24 @@ export type ContainerRegistryBlobDeleteBlobResponse = ContainerRegistryBlobDelet readableStreamBody?: NodeJS.ReadableStream; }; +/** Optional parameters. */ +export interface ContainerRegistryBlobMountBlobOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the mountBlob operation. */ export type ContainerRegistryBlobMountBlobResponse = ContainerRegistryBlobMountBlobHeaders; +/** Optional parameters. */ +export interface ContainerRegistryBlobGetUploadStatusOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getUploadStatus operation. */ export type ContainerRegistryBlobGetUploadStatusResponse = ContainerRegistryBlobGetUploadStatusHeaders; +/** Optional parameters. */ +export interface ContainerRegistryBlobUploadChunkOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the uploadChunk operation. */ export type ContainerRegistryBlobUploadChunkResponse = ContainerRegistryBlobUploadChunkHeaders; @@ -1033,15 +1089,27 @@ export type ContainerRegistryBlobUploadChunkResponse = ContainerRegistryBlobUplo export interface ContainerRegistryBlobCompleteUploadOptionalParams extends coreClient.OperationOptions { /** Optional raw data of blob */ - value?: coreHttps.RequestBodyType; + value?: coreRestPipeline.RequestBodyType; } /** Contains response data for the completeUpload operation. */ export type ContainerRegistryBlobCompleteUploadResponse = ContainerRegistryBlobCompleteUploadHeaders; +/** Optional parameters. */ +export interface ContainerRegistryBlobCancelUploadOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ContainerRegistryBlobStartUploadOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the startUpload operation. */ export type ContainerRegistryBlobStartUploadResponse = ContainerRegistryBlobStartUploadHeaders; +/** Optional parameters. */ +export interface ContainerRegistryBlobGetChunkOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the getChunk operation. */ export type ContainerRegistryBlobGetChunkResponse = ContainerRegistryBlobGetChunkHeaders & { /** @@ -1060,6 +1128,10 @@ export type ContainerRegistryBlobGetChunkResponse = ContainerRegistryBlobGetChun readableStreamBody?: NodeJS.ReadableStream; }; +/** Optional parameters. */ +export interface ContainerRegistryBlobCheckChunkExistsOptionalParams + extends coreClient.OperationOptions {} + /** Contains response data for the checkChunkExists operation. */ export type ContainerRegistryBlobCheckChunkExistsResponse = ContainerRegistryBlobCheckChunkExistsHeaders; diff --git a/sdk/containerregistry/container-registry/src/generated/operations/authentication.ts b/sdk/containerregistry/container-registry/src/generated/operations/authentication.ts index 4adc5bd654e6..d4e078be69dc 100644 --- a/sdk/containerregistry/container-registry/src/generated/operations/authentication.ts +++ b/sdk/containerregistry/container-registry/src/generated/operations/authentication.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { Authentication } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; @@ -18,7 +19,7 @@ import { } from "../models"; /** Class representing a Authentication. */ -export class Authentication { +export class AuthenticationImpl implements Authentication { private readonly client: GeneratedClientContext; /** diff --git a/sdk/containerregistry/container-registry/src/generated/operations/containerRegistry.ts b/sdk/containerregistry/container-registry/src/generated/operations/containerRegistry.ts index f9906614b4ac..9b6e18ae944b 100644 --- a/sdk/containerregistry/container-registry/src/generated/operations/containerRegistry.ts +++ b/sdk/containerregistry/container-registry/src/generated/operations/containerRegistry.ts @@ -6,27 +6,36 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { ContainerRegistry } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { GeneratedClientContext } from "../generatedClientContext"; import { + ContainerRegistryCheckDockerV2SupportOptionalParams, ContainerRegistryGetManifestOptionalParams, ContainerRegistryGetManifestResponse, Manifest, + ContainerRegistryCreateManifestOptionalParams, ContainerRegistryCreateManifestResponse, + ContainerRegistryDeleteManifestOptionalParams, ContainerRegistryGetRepositoriesOptionalParams, ContainerRegistryGetRepositoriesResponse, + ContainerRegistryGetPropertiesOptionalParams, ContainerRegistryGetPropertiesResponse, + ContainerRegistryDeleteRepositoryOptionalParams, ContainerRegistryUpdatePropertiesOptionalParams, ContainerRegistryUpdatePropertiesResponse, ContainerRegistryGetTagsOptionalParams, ContainerRegistryGetTagsResponse, + ContainerRegistryGetTagPropertiesOptionalParams, ContainerRegistryGetTagPropertiesResponse, ContainerRegistryUpdateTagAttributesOptionalParams, ContainerRegistryUpdateTagAttributesResponse, + ContainerRegistryDeleteTagOptionalParams, ContainerRegistryGetManifestsOptionalParams, ContainerRegistryGetManifestsResponse, + ContainerRegistryGetManifestPropertiesOptionalParams, ContainerRegistryGetManifestPropertiesResponse, ContainerRegistryUpdateManifestPropertiesOptionalParams, ContainerRegistryUpdateManifestPropertiesResponse, @@ -39,7 +48,7 @@ import { } from "../models"; /** Class representing a ContainerRegistry. */ -export class ContainerRegistry { +export class ContainerRegistryImpl implements ContainerRegistry { private readonly client: GeneratedClientContext; /** @@ -54,7 +63,9 @@ export class ContainerRegistry { * Tells whether this Docker Registry instance supports Docker Registry HTTP API v2 * @param options The options parameters. */ - checkDockerV2Support(options?: coreClient.OperationOptions): Promise { + checkDockerV2Support( + options?: ContainerRegistryCheckDockerV2SupportOptionalParams + ): Promise { return this.client.sendOperationRequest( { options }, checkDockerV2SupportOperationSpec @@ -89,7 +100,7 @@ export class ContainerRegistry { name: string, reference: string, payload: Manifest, - options?: coreClient.OperationOptions + options?: ContainerRegistryCreateManifestOptionalParams ): Promise { return this.client.sendOperationRequest( { name, reference, payload, options }, @@ -107,7 +118,7 @@ export class ContainerRegistry { deleteManifest( name: string, reference: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryDeleteManifestOptionalParams ): Promise { return this.client.sendOperationRequest( { name, reference, options }, @@ -135,7 +146,7 @@ export class ContainerRegistry { */ getProperties( name: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryGetPropertiesOptionalParams ): Promise { return this.client.sendOperationRequest( { name, options }, @@ -150,7 +161,7 @@ export class ContainerRegistry { */ deleteRepository( name: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryDeleteRepositoryOptionalParams ): Promise { return this.client.sendOperationRequest( { name, options }, @@ -197,7 +208,7 @@ export class ContainerRegistry { getTagProperties( name: string, reference: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryGetTagPropertiesOptionalParams ): Promise { return this.client.sendOperationRequest( { name, reference, options }, @@ -231,7 +242,7 @@ export class ContainerRegistry { deleteTag( name: string, reference: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryDeleteTagOptionalParams ): Promise { return this.client.sendOperationRequest( { name, reference, options }, @@ -263,7 +274,7 @@ export class ContainerRegistry { getManifestProperties( name: string, digest: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryGetManifestPropertiesOptionalParams ): Promise { return this.client.sendOperationRequest( { name, digest, options }, diff --git a/sdk/containerregistry/container-registry/src/generated/operations/containerRegistryBlob.ts b/sdk/containerregistry/container-registry/src/generated/operations/containerRegistryBlob.ts index 4404d3ad9a9b..cd3546d6a2db 100644 --- a/sdk/containerregistry/container-registry/src/generated/operations/containerRegistryBlob.ts +++ b/sdk/containerregistry/container-registry/src/generated/operations/containerRegistryBlob.ts @@ -6,27 +6,38 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { ContainerRegistryBlob } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; -import * as coreHttps from "@azure/core-rest-pipeline"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { GeneratedClientContext } from "../generatedClientContext"; import { + ContainerRegistryBlobGetBlobOptionalParams, ContainerRegistryBlobGetBlobResponse, + ContainerRegistryBlobCheckBlobExistsOptionalParams, ContainerRegistryBlobCheckBlobExistsResponse, + ContainerRegistryBlobDeleteBlobOptionalParams, ContainerRegistryBlobDeleteBlobResponse, + ContainerRegistryBlobMountBlobOptionalParams, ContainerRegistryBlobMountBlobResponse, + ContainerRegistryBlobGetUploadStatusOptionalParams, ContainerRegistryBlobGetUploadStatusResponse, + ContainerRegistryBlobUploadChunkOptionalParams, ContainerRegistryBlobUploadChunkResponse, ContainerRegistryBlobCompleteUploadOptionalParams, ContainerRegistryBlobCompleteUploadResponse, + ContainerRegistryBlobCancelUploadOptionalParams, + ContainerRegistryBlobStartUploadOptionalParams, ContainerRegistryBlobStartUploadResponse, + ContainerRegistryBlobGetChunkOptionalParams, ContainerRegistryBlobGetChunkResponse, + ContainerRegistryBlobCheckChunkExistsOptionalParams, ContainerRegistryBlobCheckChunkExistsResponse } from "../models"; /** Class representing a ContainerRegistryBlob. */ -export class ContainerRegistryBlob { +export class ContainerRegistryBlobImpl implements ContainerRegistryBlob { private readonly client: GeneratedClientContext; /** @@ -46,7 +57,7 @@ export class ContainerRegistryBlob { getBlob( name: string, digest: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobGetBlobOptionalParams ): Promise { return this.client.sendOperationRequest( { name, digest, options }, @@ -63,7 +74,7 @@ export class ContainerRegistryBlob { checkBlobExists( name: string, digest: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobCheckBlobExistsOptionalParams ): Promise { return this.client.sendOperationRequest( { name, digest, options }, @@ -80,7 +91,7 @@ export class ContainerRegistryBlob { deleteBlob( name: string, digest: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobDeleteBlobOptionalParams ): Promise { return this.client.sendOperationRequest( { name, digest, options }, @@ -99,7 +110,7 @@ export class ContainerRegistryBlob { name: string, mount: string, fromParam: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobMountBlobOptionalParams ): Promise { return this.client.sendOperationRequest( { name, mount, fromParam, options }, @@ -116,7 +127,7 @@ export class ContainerRegistryBlob { */ getUploadStatus( location: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobGetUploadStatusOptionalParams ): Promise { return this.client.sendOperationRequest( { location, options }, @@ -133,8 +144,8 @@ export class ContainerRegistryBlob { */ uploadChunk( location: string, - value: coreHttps.RequestBodyType, - options?: coreClient.OperationOptions + value: coreRestPipeline.RequestBodyType, + options?: ContainerRegistryBlobUploadChunkOptionalParams ): Promise { return this.client.sendOperationRequest( { location, value, options }, @@ -170,7 +181,7 @@ export class ContainerRegistryBlob { */ cancelUpload( location: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobCancelUploadOptionalParams ): Promise { return this.client.sendOperationRequest( { location, options }, @@ -185,7 +196,7 @@ export class ContainerRegistryBlob { */ startUpload( name: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobStartUploadOptionalParams ): Promise { return this.client.sendOperationRequest( { name, options }, @@ -206,7 +217,7 @@ export class ContainerRegistryBlob { name: string, digest: string, range: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobGetChunkOptionalParams ): Promise { return this.client.sendOperationRequest( { name, digest, range, options }, @@ -225,7 +236,7 @@ export class ContainerRegistryBlob { name: string, digest: string, range: string, - options?: coreClient.OperationOptions + options?: ContainerRegistryBlobCheckChunkExistsOptionalParams ): Promise { return this.client.sendOperationRequest( { name, digest, range, options }, diff --git a/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/authentication.ts b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/authentication.ts new file mode 100644 index 000000000000..ac0462ab6a22 --- /dev/null +++ b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/authentication.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + AuthenticationExchangeAadAccessTokenForAcrRefreshTokenOptionalParams, + AuthenticationExchangeAadAccessTokenForAcrRefreshTokenResponse, + AuthenticationExchangeAcrRefreshTokenForAcrAccessTokenOptionalParams, + AuthenticationExchangeAcrRefreshTokenForAcrAccessTokenResponse +} from "../models"; + +/** Interface representing a Authentication. */ +export interface Authentication { + /** + * Exchange AAD tokens for an ACR refresh Token + * @param options The options parameters. + */ + exchangeAadAccessTokenForAcrRefreshToken( + options?: AuthenticationExchangeAadAccessTokenForAcrRefreshTokenOptionalParams + ): Promise; + /** + * Exchange ACR Refresh token for an ACR Access Token + * @param options The options parameters. + */ + exchangeAcrRefreshTokenForAcrAccessToken( + options?: AuthenticationExchangeAcrRefreshTokenForAcrAccessTokenOptionalParams + ): Promise; +} diff --git a/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/containerRegistry.ts b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/containerRegistry.ts new file mode 100644 index 000000000000..8591964af2d9 --- /dev/null +++ b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/containerRegistry.ts @@ -0,0 +1,228 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + ContainerRegistryCheckDockerV2SupportOptionalParams, + ContainerRegistryGetManifestOptionalParams, + ContainerRegistryGetManifestResponse, + Manifest, + ContainerRegistryCreateManifestOptionalParams, + ContainerRegistryCreateManifestResponse, + ContainerRegistryDeleteManifestOptionalParams, + ContainerRegistryGetRepositoriesOptionalParams, + ContainerRegistryGetRepositoriesResponse, + ContainerRegistryGetPropertiesOptionalParams, + ContainerRegistryGetPropertiesResponse, + ContainerRegistryDeleteRepositoryOptionalParams, + ContainerRegistryUpdatePropertiesOptionalParams, + ContainerRegistryUpdatePropertiesResponse, + ContainerRegistryGetTagsOptionalParams, + ContainerRegistryGetTagsResponse, + ContainerRegistryGetTagPropertiesOptionalParams, + ContainerRegistryGetTagPropertiesResponse, + ContainerRegistryUpdateTagAttributesOptionalParams, + ContainerRegistryUpdateTagAttributesResponse, + ContainerRegistryDeleteTagOptionalParams, + ContainerRegistryGetManifestsOptionalParams, + ContainerRegistryGetManifestsResponse, + ContainerRegistryGetManifestPropertiesOptionalParams, + ContainerRegistryGetManifestPropertiesResponse, + ContainerRegistryUpdateManifestPropertiesOptionalParams, + ContainerRegistryUpdateManifestPropertiesResponse, + ContainerRegistryGetRepositoriesNextOptionalParams, + ContainerRegistryGetRepositoriesNextResponse, + ContainerRegistryGetTagsNextOptionalParams, + ContainerRegistryGetTagsNextResponse, + ContainerRegistryGetManifestsNextOptionalParams, + ContainerRegistryGetManifestsNextResponse +} from "../models"; + +/** Interface representing a ContainerRegistry. */ +export interface ContainerRegistry { + /** + * Tells whether this Docker Registry instance supports Docker Registry HTTP API v2 + * @param options The options parameters. + */ + checkDockerV2Support( + options?: ContainerRegistryCheckDockerV2SupportOptionalParams + ): Promise; + /** + * Get the manifest identified by `name` and `reference` where `reference` can be a tag or digest. + * @param name Name of the image (including the namespace) + * @param reference A tag or a digest, pointing to a specific image + * @param options The options parameters. + */ + getManifest( + name: string, + reference: string, + options?: ContainerRegistryGetManifestOptionalParams + ): Promise; + /** + * Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest. + * @param name Name of the image (including the namespace) + * @param reference A tag or a digest, pointing to a specific image + * @param payload Manifest body, can take v1 or v2 values depending on accept header + * @param options The options parameters. + */ + createManifest( + name: string, + reference: string, + payload: Manifest, + options?: ContainerRegistryCreateManifestOptionalParams + ): Promise; + /** + * Delete the manifest identified by `name` and `reference`. Note that a manifest can _only_ be deleted + * by `digest`. + * @param name Name of the image (including the namespace) + * @param reference Digest of a BLOB + * @param options The options parameters. + */ + deleteManifest( + name: string, + reference: string, + options?: ContainerRegistryDeleteManifestOptionalParams + ): Promise; + /** + * List repositories + * @param options The options parameters. + */ + getRepositories( + options?: ContainerRegistryGetRepositoriesOptionalParams + ): Promise; + /** + * Get repository attributes + * @param name Name of the image (including the namespace) + * @param options The options parameters. + */ + getProperties( + name: string, + options?: ContainerRegistryGetPropertiesOptionalParams + ): Promise; + /** + * Delete the repository identified by `name` + * @param name Name of the image (including the namespace) + * @param options The options parameters. + */ + deleteRepository( + name: string, + options?: ContainerRegistryDeleteRepositoryOptionalParams + ): Promise; + /** + * Update the attribute identified by `name` where `reference` is the name of the repository. + * @param name Name of the image (including the namespace) + * @param options The options parameters. + */ + updateProperties( + name: string, + options?: ContainerRegistryUpdatePropertiesOptionalParams + ): Promise; + /** + * List tags of a repository + * @param name Name of the image (including the namespace) + * @param options The options parameters. + */ + getTags( + name: string, + options?: ContainerRegistryGetTagsOptionalParams + ): Promise; + /** + * Get tag attributes by tag + * @param name Name of the image (including the namespace) + * @param reference Tag name + * @param options The options parameters. + */ + getTagProperties( + name: string, + reference: string, + options?: ContainerRegistryGetTagPropertiesOptionalParams + ): Promise; + /** + * Update tag attributes + * @param name Name of the image (including the namespace) + * @param reference Tag name + * @param options The options parameters. + */ + updateTagAttributes( + name: string, + reference: string, + options?: ContainerRegistryUpdateTagAttributesOptionalParams + ): Promise; + /** + * Delete tag + * @param name Name of the image (including the namespace) + * @param reference Tag name + * @param options The options parameters. + */ + deleteTag( + name: string, + reference: string, + options?: ContainerRegistryDeleteTagOptionalParams + ): Promise; + /** + * List manifests of a repository + * @param name Name of the image (including the namespace) + * @param options The options parameters. + */ + getManifests( + name: string, + options?: ContainerRegistryGetManifestsOptionalParams + ): Promise; + /** + * Get manifest attributes + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param options The options parameters. + */ + getManifestProperties( + name: string, + digest: string, + options?: ContainerRegistryGetManifestPropertiesOptionalParams + ): Promise; + /** + * Update properties of a manifest + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param options The options parameters. + */ + updateManifestProperties( + name: string, + digest: string, + options?: ContainerRegistryUpdateManifestPropertiesOptionalParams + ): Promise; + /** + * GetRepositoriesNext + * @param nextLink The nextLink from the previous successful call to the GetRepositories method. + * @param options The options parameters. + */ + getRepositoriesNext( + nextLink: string, + options?: ContainerRegistryGetRepositoriesNextOptionalParams + ): Promise; + /** + * GetTagsNext + * @param name Name of the image (including the namespace) + * @param nextLink The nextLink from the previous successful call to the GetTags method. + * @param options The options parameters. + */ + getTagsNext( + name: string, + nextLink: string, + options?: ContainerRegistryGetTagsNextOptionalParams + ): Promise; + /** + * GetManifestsNext + * @param name Name of the image (including the namespace) + * @param nextLink The nextLink from the previous successful call to the GetManifests method. + * @param options The options parameters. + */ + getManifestsNext( + name: string, + nextLink: string, + options?: ContainerRegistryGetManifestsNextOptionalParams + ): Promise; +} diff --git a/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/containerRegistryBlob.ts b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/containerRegistryBlob.ts new file mode 100644 index 000000000000..4f8d82092b09 --- /dev/null +++ b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/containerRegistryBlob.ts @@ -0,0 +1,166 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + ContainerRegistryBlobGetBlobOptionalParams, + ContainerRegistryBlobGetBlobResponse, + ContainerRegistryBlobCheckBlobExistsOptionalParams, + ContainerRegistryBlobCheckBlobExistsResponse, + ContainerRegistryBlobDeleteBlobOptionalParams, + ContainerRegistryBlobDeleteBlobResponse, + ContainerRegistryBlobMountBlobOptionalParams, + ContainerRegistryBlobMountBlobResponse, + ContainerRegistryBlobGetUploadStatusOptionalParams, + ContainerRegistryBlobGetUploadStatusResponse, + ContainerRegistryBlobUploadChunkOptionalParams, + ContainerRegistryBlobUploadChunkResponse, + ContainerRegistryBlobCompleteUploadOptionalParams, + ContainerRegistryBlobCompleteUploadResponse, + ContainerRegistryBlobCancelUploadOptionalParams, + ContainerRegistryBlobStartUploadOptionalParams, + ContainerRegistryBlobStartUploadResponse, + ContainerRegistryBlobGetChunkOptionalParams, + ContainerRegistryBlobGetChunkResponse, + ContainerRegistryBlobCheckChunkExistsOptionalParams, + ContainerRegistryBlobCheckChunkExistsResponse +} from "../models"; + +/** Interface representing a ContainerRegistryBlob. */ +export interface ContainerRegistryBlob { + /** + * Retrieve the blob from the registry identified by digest. + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param options The options parameters. + */ + getBlob( + name: string, + digest: string, + options?: ContainerRegistryBlobGetBlobOptionalParams + ): Promise; + /** + * Same as GET, except only the headers are returned. + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param options The options parameters. + */ + checkBlobExists( + name: string, + digest: string, + options?: ContainerRegistryBlobCheckBlobExistsOptionalParams + ): Promise; + /** + * Removes an already uploaded blob. + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param options The options parameters. + */ + deleteBlob( + name: string, + digest: string, + options?: ContainerRegistryBlobDeleteBlobOptionalParams + ): Promise; + /** + * Mount a blob identified by the `mount` parameter from another repository. + * @param name Name of the image (including the namespace) + * @param mount Digest of blob to mount from the source repository. + * @param fromParam Name of the source repository. + * @param options The options parameters. + */ + mountBlob( + name: string, + mount: string, + fromParam: string, + options?: ContainerRegistryBlobMountBlobOptionalParams + ): Promise; + /** + * Retrieve status of upload identified by uuid. The primary purpose of this endpoint is to resolve the + * current status of a resumable upload. + * @param location Link acquired from upload start or previous chunk. Note, do not include initial / + * (must do substring(1) ) + * @param options The options parameters. + */ + getUploadStatus( + location: string, + options?: ContainerRegistryBlobGetUploadStatusOptionalParams + ): Promise; + /** + * Upload a stream of data without completing the upload. + * @param location Link acquired from upload start or previous chunk. Note, do not include initial / + * (must do substring(1) ) + * @param value Raw data of blob + * @param options The options parameters. + */ + uploadChunk( + location: string, + value: coreRestPipeline.RequestBodyType, + options?: ContainerRegistryBlobUploadChunkOptionalParams + ): Promise; + /** + * Complete the upload, providing all the data in the body, if necessary. A request without a body will + * just complete the upload with previously uploaded content. + * @param digest Digest of a BLOB + * @param location Link acquired from upload start or previous chunk. Note, do not include initial / + * (must do substring(1) ) + * @param options The options parameters. + */ + completeUpload( + digest: string, + location: string, + options?: ContainerRegistryBlobCompleteUploadOptionalParams + ): Promise; + /** + * Cancel outstanding upload processes, releasing associated resources. If this is not called, the + * unfinished uploads will eventually timeout. + * @param location Link acquired from upload start or previous chunk. Note, do not include initial / + * (must do substring(1) ) + * @param options The options parameters. + */ + cancelUpload( + location: string, + options?: ContainerRegistryBlobCancelUploadOptionalParams + ): Promise; + /** + * Initiate a resumable blob upload with an empty request body. + * @param name Name of the image (including the namespace) + * @param options The options parameters. + */ + startUpload( + name: string, + options?: ContainerRegistryBlobStartUploadOptionalParams + ): Promise; + /** + * Retrieve the blob from the registry identified by `digest`. This endpoint may also support RFC7233 + * compliant range requests. Support can be detected by issuing a HEAD request. If the header + * `Accept-Range: bytes` is returned, range requests can be used to fetch partial content. + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param range Format : bytes=-, HTTP Range header specifying blob chunk. + * @param options The options parameters. + */ + getChunk( + name: string, + digest: string, + range: string, + options?: ContainerRegistryBlobGetChunkOptionalParams + ): Promise; + /** + * Same as GET, except only the headers are returned. + * @param name Name of the image (including the namespace) + * @param digest Digest of a BLOB + * @param range Format : bytes=-, HTTP Range header specifying blob chunk. + * @param options The options parameters. + */ + checkChunkExists( + name: string, + digest: string, + range: string, + options?: ContainerRegistryBlobCheckChunkExistsOptionalParams + ): Promise; +} diff --git a/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/index.ts b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/index.ts new file mode 100644 index 000000000000..b6666ac1ae96 --- /dev/null +++ b/sdk/containerregistry/container-registry/src/generated/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./containerRegistry"; +export * from "./containerRegistryBlob"; +export * from "./authentication"; diff --git a/sdk/containerregistry/container-registry/swagger/README.md b/sdk/containerregistry/container-registry/swagger/README.md index 144e4c441f9e..a3f9c0acad9d 100644 --- a/sdk/containerregistry/container-registry/swagger/README.md +++ b/sdk/containerregistry/container-registry/swagger/README.md @@ -19,8 +19,7 @@ add-credentials: false override-client-name: GeneratedClient disable-async-iterators: true hide-clients: true -use-core-v2: true use-extension: - "@autorest/typescript": "C:/github/autorest.typescript" + "@autorest/typescript": "6.0.0-beta.4" package-version: 1.0.0-beta.4 ```