Skip to content

Commit

Permalink
circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ljian3377 committed Sep 23, 2020
1 parent 7fed91e commit 278efc5
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 308 deletions.
71 changes: 64 additions & 7 deletions sdk/storage/storage-file-share/src/ShareClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { Credential } from "./credentials/Credential";
import { StorageSharedKeyCredential } from "./credentials/StorageSharedKeyCredential";
import { AnonymousCredential } from "./credentials/AnonymousCredential";
import { createSpan } from "./utils/tracing";
import { LeaseAccessConditions } from "./generated/src/models";

/**
* Options to configure the {@link ShareClient.create} operation.
Expand Down Expand Up @@ -103,6 +104,13 @@ export interface ShareDeleteMethodOptions extends CommonOptions {
* @memberof ShareDeleteMethodOptions
*/
deleteSnapshots?: DeleteSnapshotsOptionType;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareDeleteMethodOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -120,6 +128,13 @@ export interface ShareSetMetadataOptions extends CommonOptions {
* @memberof ShareSetMetadataOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareSetMetadataOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -137,6 +152,13 @@ export interface ShareSetAccessPolicyOptions extends CommonOptions {
* @memberof ShareSetAccessPolicyOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareSetAccessPolicyOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -154,6 +176,13 @@ export interface ShareGetAccessPolicyOptions extends CommonOptions {
* @memberof ShareGetAccessPolicyOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareGetAccessPolicyOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -171,6 +200,13 @@ export interface ShareExistsOptions extends CommonOptions {
* @memberof ShareExistsOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareExistsOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -188,6 +224,13 @@ export interface ShareGetPropertiesOptions extends CommonOptions {
* @memberof ShareGetPropertiesOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareGetPropertiesOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -205,6 +248,13 @@ export interface ShareSetQuotaOptions extends CommonOptions {
* @memberof ShareSetQuotaOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareSetQuotaOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand All @@ -222,6 +272,13 @@ export interface ShareGetStatisticsOptions extends CommonOptions {
* @memberof ShareGetStatisticsOptions
*/
abortSignal?: AbortSignalLike;
/**
* If specified, the operation only succeeds if the resource's lease is active and matches this ID.
*
* @type {LeaseAccessConditions}
* @memberof ShareGetStatisticsOptions
*/
leaseAccessConditions?: LeaseAccessConditions;
}

/**
Expand Down Expand Up @@ -794,7 +851,7 @@ export class ShareClient extends StorageClient {
const { span, spanOptions } = createSpan("ShareClient-exists", options.tracingOptions);
try {
await this.getProperties({
abortSignal: options.abortSignal,
...options,
tracingOptions: { ...options.tracingOptions, spanOptions }
});
return true;
Expand Down Expand Up @@ -835,7 +892,7 @@ export class ShareClient extends StorageClient {
const { span, spanOptions } = createSpan("ShareClient-getProperties", options.tracingOptions);
try {
return await this.context.getProperties({
abortSignal: options.abortSignal,
...options,
spanOptions
});
} catch (e) {
Expand Down Expand Up @@ -939,7 +996,7 @@ export class ShareClient extends StorageClient {
const { span, spanOptions } = createSpan("ShareClient-setMetadata", options.tracingOptions);
try {
return await this.context.setMetadata({
abortSignal: options.abortSignal,
...options,
metadata,
spanOptions
});
Expand Down Expand Up @@ -973,7 +1030,7 @@ export class ShareClient extends StorageClient {
const { span, spanOptions } = createSpan("ShareClient-getAccessPolicy", options.tracingOptions);
try {
const response = await this.context.getAccessPolicy({
abortSignal: options.abortSignal,
...options,
spanOptions
});

Expand Down Expand Up @@ -1047,7 +1104,7 @@ export class ShareClient extends StorageClient {
}

return await this.context.setAccessPolicy({
abortSignal: options.abortSignal,
...options,
shareAcl: acl,
spanOptions
});
Expand Down Expand Up @@ -1110,7 +1167,7 @@ export class ShareClient extends StorageClient {
);
}
return await this.context.setQuota({
abortSignal: options.abortSignal,
...options,
quota: quotaInGB,
spanOptions
});
Expand Down Expand Up @@ -1138,7 +1195,7 @@ export class ShareClient extends StorageClient {
const { span, spanOptions } = createSpan("ShareClient-getStatistics", options.tracingOptions);
try {
const response = await this.context.getStatistics({
abortSignal: options.abortSignal,
...options,
spanOptions
});

Expand Down
Loading

0 comments on commit 278efc5

Please sign in to comment.