Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshaNalluru committed May 29, 2019
2 parents 43d30c0 + dd71e12 commit bc932b3
Show file tree
Hide file tree
Showing 64 changed files with 529 additions and 680 deletions.
36 changes: 2 additions & 34 deletions sdk/storage/storage-blob/src/AppendBlobClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import { HttpRequestBody, TransferProgressEvent } from "@azure/ms-rest-js";

import * as Models from "./generated/lib/models";
import { Aborter } from "./Aborter";
import { BlobClient } from "./BlobClient";
import { ContainerClient } from "./ContainerClient";
import { BlobClient } from "./internal";
import { AppendBlob } from "./generated/lib/operations";
import { AppendBlobAccessConditions, BlobAccessConditions, Metadata } from "./models";
import { Pipeline } from "./Pipeline";
import { URLConstants } from "./utils/constants";
import { appendToURLPath, setURLParameter } from "./utils/utils.common";
import { setURLParameter } from "./utils/utils.common";

export interface AppendBlobCreateOptions {
abortSignal?: Aborter;
Expand All @@ -35,37 +34,6 @@ export interface AppendBlobAppendBlockOptions {
* @extends {StorageClient}
*/
export class AppendBlobClient extends BlobClient {
/**
* Creates a AppendBlobClient object from ContainerClient instance.
*
* @static
* @param {ContainerClient} containerClient A ContainerClient object
* @param {string} blobName An append blob name
* @returns {AppendBlobClient}
* @memberof AppendBlobClient
*/
public static fromContainerClient(
containerClient: ContainerClient,
blobName: string
): AppendBlobClient {
return new AppendBlobClient(
appendToURLPath(containerClient.url, encodeURIComponent(blobName)),
containerClient.pipeline
);
}

/**
* Creates a AppendBlobClient object from BlobClient instance.
*
* @static
* @param {BlobClient} blobClient
* @returns {AppendBlobClient}
* @memberof AppendBlobClient
*/
public static fromBlobClient(blobClient: BlobClient): AppendBlobClient {
return new AppendBlobClient(blobClient.url, blobClient.pipeline);
}

/**
* appendBlobsContext provided by protocol layer.
*
Expand Down
54 changes: 35 additions & 19 deletions sdk/storage/storage-blob/src/BlobClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ import { isNode, TransferProgressEvent } from "@azure/ms-rest-js";
import * as Models from "./generated/lib/models";
import { Aborter } from "./Aborter";
import { BlobDownloadResponse } from "./BlobDownloadResponse";
import { ContainerClient } from "./ContainerClient";
import { Blob } from "./generated/lib/operations";
import { rangeToString } from "./Range";
import { BlobAccessConditions, Metadata } from "./models";
import { Pipeline } from "./Pipeline";
import { StorageClient } from "./StorageClient";
import { StorageClient } from "./internal";
import { DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, URLConstants } from "./utils/constants";
import { appendToURLPath, setURLParameter } from "./utils/utils.common";
import { setURLParameter } from "./utils/utils.common";
import { AppendBlobClient } from "./internal";
import { BlockBlobClient } from "./internal";
import { PageBlobClient } from "./internal";

export interface BlobDownloadOptions {
abortSignal?: Aborter;
Expand Down Expand Up @@ -122,22 +124,6 @@ export interface BlobSetTierOptions {
* @extends {StorageClient}
*/
export class BlobClient extends StorageClient {
/**
* Creates a BlobClient object from an ContainerClient object.
*
* @static
* @param {ContainerClient} containerClient A ContainerClient object
* @param {string} blobName A blob name
* @returns
* @memberof BlobClient
*/
public static fromContainerClient(containerClient: ContainerClient, blobName: string) {
return new BlobClient(
appendToURLPath(containerClient.url, encodeURIComponent(blobName)),
containerClient.pipeline
);
}

/**
* blobContext provided by protocol layer.
*
Expand Down Expand Up @@ -201,6 +187,36 @@ export class BlobClient extends StorageClient {
);
}

/**
* Creates a AppendBlobClient object.
*
* @returns {AppendBlobClient}
* @memberof BlobClient
*/
public createAppendBlobClient(): AppendBlobClient {
return new AppendBlobClient(this.url, this.pipeline);
}

/**
* Creates a BlockBlobClient object.
*
* @returns {BlockBlobClient}
* @memberof BlobClient
*/
public createBlockBlobClient(): BlockBlobClient {
return new BlockBlobClient(this.url, this.pipeline);
}

/**
* Creates a PageBlobClient object.
*
* @returns {PageBlobClient}
* @memberof BlobClient
*/
public createPageBlobClient(): PageBlobClient {
return new PageBlobClient(this.url, this.pipeline);
}

/**
* Reads or downloads a blob from the system, including its metadata and properties.
* You can also call Get Blob to read a snapshot.
Expand Down
20 changes: 19 additions & 1 deletion sdk/storage/storage-blob/src/BlobServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { Aborter } from "./Aborter";
import { ListContainersIncludeType } from "./generated/lib/models/index";
import { Service } from "./generated/lib/operations";
import { Pipeline } from "./Pipeline";
import { StorageClient } from "./StorageClient";
import { StorageClient } from "./internal";
import { ContainerClient } from "./ContainerClient";
import { appendToURLPath } from "./utils/utils.common";

export interface ServiceGetPropertiesOptions {
abortSignal?: Aborter;
Expand Down Expand Up @@ -94,6 +96,22 @@ export class BlobServiceClient extends StorageClient {
return new BlobServiceClient(this.url, pipeline);
}

/**
* Creates a ContainerClient object
*
* @param containerName A container name
* @returns {ContainerClient}
* @memberof BlobServiceClient
*/
public createContainerClient(
containerName: string
): ContainerClient {
return new ContainerClient(
appendToURLPath(this.url, encodeURIComponent(containerName)),
this.pipeline
);
}

/**
* Gets the properties of a storage account’s Blob service, including properties
* for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
Expand Down
35 changes: 2 additions & 33 deletions sdk/storage/storage-blob/src/BlockBlobClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { HttpRequestBody, TransferProgressEvent } from "@azure/ms-rest-js";

import * as Models from "./generated/lib/models";
import { Aborter } from "./Aborter";
import { BlobClient } from "./BlobClient";
import { ContainerClient } from "./ContainerClient";
import { BlobClient } from "./internal";
import { BlockBlob } from "./generated/lib/operations";
import { Range, rangeToString } from "./Range";
import { BlobAccessConditions, Metadata } from "./models";
import { Pipeline } from "./Pipeline";
import { URLConstants } from "./utils/constants";
import { appendToURLPath, setURLParameter } from "./utils/utils.common";
import { setURLParameter } from "./utils/utils.common";

export interface BlockBlobUploadOptions {
abortSignal?: Aborter;
Expand Down Expand Up @@ -56,36 +55,6 @@ export interface BlockBlobGetBlockListOptions {
* @extends {StorageClient}
*/
export class BlockBlobClient extends BlobClient {
/**
* Creates a BlockBlobClient object from ContainerClient instance.
*
* @static
* @param {ContainerClient} containerClient A ContainerClient object
* @param {string} blobName A block blob name
* @returns {BlockBlobClient}
* @memberof BlockBlobClient
*/
public static fromContainerClient(
containerClient: ContainerClient,
blobName: string
): BlockBlobClient {
return new BlockBlobClient(
appendToURLPath(containerClient.url, encodeURIComponent(blobName)),
containerClient.pipeline
);
}

/**
* Creates a BlockBlobClient object from BlobClient instance.
*
* @static
* @param {BlobClient} blobClient
* @returns {BlockBlobClient}
* @memberof BlockBlobClient
*/
public static fromBlobClient(blobClient: BlobClient): BlockBlobClient {
return new BlockBlobClient(blobClient.url, blobClient.pipeline);
}

/**
* blockBlobContext provided by protocol layer.
Expand Down
85 changes: 67 additions & 18 deletions sdk/storage/storage-blob/src/ContainerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import { Aborter } from "./Aborter";
import { Container } from "./generated/lib/operations";
import { ContainerAccessConditions, Metadata } from "./models";
import { Pipeline } from "./Pipeline";
import { BlobServiceClient } from "./BlobServiceClient";
import { StorageClient } from "./StorageClient";
import { StorageClient } from "./internal";
import { ETagNone } from "./utils/constants";
import { appendToURLPath, truncatedISO8061Date } from "./utils/utils.common";
import { BlobClient } from "./internal";
import { AppendBlobClient } from "./internal";
import { BlockBlobClient } from "./internal";
import { PageBlobClient } from "./internal";

export interface ContainerCreateOptions {
abortSignal?: Aborter;
Expand Down Expand Up @@ -147,22 +150,6 @@ export interface ContainerListBlobsSegmentOptions {
* @extends {StorageClient}
*/
export class ContainerClient extends StorageClient {
/**
* Creates a ContainerClient object from BlobServiceClient
*
* @param blobServiceClient A BlobServiceClient object
* @param containerName A container name
*/
public static fromBlobServiceClient(
blobServiceClient: BlobServiceClient,
containerName: string
): ContainerClient {
return new ContainerClient(
appendToURLPath(blobServiceClient.url, encodeURIComponent(containerName)),
blobServiceClient.pipeline
);
}

/**
* containerContext provided by protocol layer.
*
Expand Down Expand Up @@ -221,6 +208,68 @@ export class ContainerClient extends StorageClient {
});
}

/**
* Creates a BlobClient object.
*
* @param {string} blobName A blob name
* @returns
* @memberof BlobClient
*/
public createBlobClient(blobName: string) {
return new BlobClient(
appendToURLPath(this.url, encodeURIComponent(blobName)),
this.pipeline
);
}

/**
* Creates a AppendBlobClient object.
*
* @param {string} blobName An append blob name
* @returns {AppendBlobClient}
* @memberof ContainerClient
*/
public createAppendBlobClient(
blobName: string
): AppendBlobClient {
return new AppendBlobClient(
appendToURLPath(this.url, encodeURIComponent(blobName)),
this.pipeline
);
}

/**
* Creates a BlockBlobClient object.
*
* @param {string} blobName A block blob name
* @returns {BlockBlobClient}
* @memberof ContainerClient
*/
public createBlockBlobClient(
blobName: string
): BlockBlobClient {
return new BlockBlobClient(
appendToURLPath(this.url, encodeURIComponent(blobName)),
this.pipeline
);
}

/**
* Creates a PageBlobClient object.
*
* @param {string} blobName A page blob name
* @returns {PageBlobClient}
* @memberof ContainerClient
*/
public createPageBlobClient(
blobName: string
): PageBlobClient {
return new PageBlobClient(
appendToURLPath(this.url, encodeURIComponent(blobName)),
this.pipeline
);
}

/**
* Returns all user-defined metadata and system properties for the specified
* container. The data returned does not include the container's list of blobs.
Expand Down
35 changes: 2 additions & 33 deletions sdk/storage/storage-blob/src/PageBlobClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { HttpRequestBody, TransferProgressEvent } from "@azure/ms-rest-js";

import * as Models from "./generated/lib/models";
import { Aborter } from "./Aborter";
import { BlobClient } from "./BlobClient";
import { ContainerClient } from "./ContainerClient";
import { BlobClient } from "./internal";
import { PageBlob } from "./generated/lib/operations";
import { rangeToString } from "./Range";
import { BlobAccessConditions, Metadata, PageBlobAccessConditions } from "./models";
import { Pipeline } from "./Pipeline";
import { URLConstants } from "./utils/constants";
import { appendToURLPath, setURLParameter } from "./utils/utils.common";
import { setURLParameter } from "./utils/utils.common";

export interface PageBlobCreateOptions {
abortSignal?: Aborter;
Expand Down Expand Up @@ -68,36 +67,6 @@ export interface PageBlobStartCopyIncrementalOptions {
* @extends {StorageClient}
*/
export class PageBlobClient extends BlobClient {
/**
* Creates a PageBlobClient object from ContainerClient instance.
*
* @static
* @param {ContainerClient} containerClient A ContainerClient object
* @param {string} blobName A page blob name
* @returns {PageBlobClient}
* @memberof PageBlobClient
*/
public static fromContainerClient(
containerClient: ContainerClient,
blobName: string
): PageBlobClient {
return new PageBlobClient(
appendToURLPath(containerClient.url, encodeURIComponent(blobName)),
containerClient.pipeline
);
}

/**
* Creates a PageBlobClient object from BlobClient instance.
*
* @static
* @param {BlobClient} blobClient
* @returns {PageBlobClient}
* @memberof PageBlobClient
*/
public static fromBlobClient(blobClient: BlobClient): PageBlobClient {
return new PageBlobClient(blobClient.url, blobClient.pipeline);
}

/**
* pageBlobsContext provided by protocol layer.
Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/storage-blob/src/highlevel.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { generateUuid, TransferProgressEvent } from "@azure/ms-rest-js";
import { Readable } from "stream";

import { Aborter } from "./Aborter";
import { BlobClient } from "./BlobClient";
import { BlockBlobClient } from "./BlockBlobClient";
import { BlobClient } from "./internal";
import { BlockBlobClient } from "./internal";
import { BlobHTTPHeaders } from "./generated/lib/models";
import {
BlobUploadCommonResponse,
Expand Down
Loading

0 comments on commit bc932b3

Please sign in to comment.