Skip to content

[Storage][Blob] Flatten and simplify access conditions#5672

Merged
ramya-rao-a merged 3 commits into
Azure:masterfrom
jeremymeng:condition-consolidation
Oct 21, 2019
Merged

[Storage][Blob] Flatten and simplify access conditions#5672
ramya-rao-a merged 3 commits into
Azure:masterfrom
jeremymeng:condition-consolidation

Conversation

@jeremymeng
Copy link
Copy Markdown
Member

Per feedback from the api review.

Use a flattened conditions type BlobRequestConditions instead of current
nested one. It replaces ContainerAccessConditions and BlobAccessConditions.
In addition, various conditions fields are renamed into simply conditions
except sourceModifiedAccessConditions which is renamed to sourceConditions.
This makes it more convenient to pass in conditional request options.

One example:

{
  blobAccessConditions: {
    modifiedAccessConditions: {
      ifMatch: uploadResponse.eTag
  }
}

after this change becomes

{
  conditions: {
    ifMatch: uploadResponse.eTag
}

Resolves #5466

@jeremymeng
Copy link
Copy Markdown
Member Author

I didn't replace the usage of Models.ModifiedAccessConditions or Models.LeaseAccessConditions. If we really want we could add type aliases for them (but need good names!)

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Oct 19, 2019
Copy link
Copy Markdown
Member

@bterlson bterlson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jeremymeng jeremymeng force-pushed the condition-consolidation branch from 95b8325 to 3382142 Compare October 19, 2019 05:33
Use a flattened conditions type `BlobRequestConditions` instead of current
nested one.  It replaces `ContainerAccessConditions` and `BlobAccessConditions`.
In addition, various conditions fields are renamed into simply `conditions`.
This makes it more convenient to pass in conditional request options.

the example

```js
{
  blobAccessConditions: {
    modifiedAccessConditions: {
      ifMatch: uploadResponse.eTag
  }
}

```

after this change becomes

```js
{
  conditions: {
    ifMatch: uploadResponse.eTag
}
```
@jeremymeng jeremymeng force-pushed the condition-consolidation branch from 3382142 to 862f930 Compare October 20, 2019 07:03
Comment thread sdk/storage/storage-blob/src/PageBlobClient.ts
Copy link
Copy Markdown
Member

@XiaoningLiu XiaoningLiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ramya-rao-a
Copy link
Copy Markdown
Contributor

Pushed commits to resolve merge conflicts

Copy link
Copy Markdown
Member

@jiacfan jiacfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ramya-rao-a ramya-rao-a merged commit 7e23aab into Azure:master Oct 21, 2019
chradek pushed a commit to jeremymeng/azure-sdk-for-js that referenced this pull request Oct 21, 2019
for consistency with Blob.

In PR Azure#5672 we adopted the field names `conditions` and `sourceConditions`.
This change fixes the only place in File where `SourceModifiedAccessConditions`
is used in public API to be consistent.
ramya-rao-a pushed a commit that referenced this pull request Oct 21, 2019
for consistency with Blob.

In PR #5672 we adopted the field names `conditions` and `sourceConditions`.
This change fixes the only place in File where `SourceModifiedAccessConditions`
is used in public API to be consistent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Storage] MatchCondition instead of various access condition

6 participants