Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Oct 21, 2019

Conversation

jeremymeng
Copy link
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
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
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
Copy link
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
Contributor

Pushed commits to resolve merge conflicts

Copy link
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:

jeremymeng added 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.
jeremymeng added 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 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