just azure_svc_blobstorage package-2021-02 for review of #1040#1043
just azure_svc_blobstorage package-2021-02 for review of #1040#1043cataggar wants to merge 2 commits intoAzure:mainfrom
Conversation
| } | ||
| } | ||
| pub mod get_account_info { | ||
| use super::models; | ||
| type Response = (); |
There was a problem hiding this comment.
Current into_future sends the request and returns the response body, which is (). Not very useful.
| #[derive(Clone)] | ||
| pub struct RequestBuilder { | ||
| pub(crate) client: super::super::Client, | ||
| pub(crate) x_ms_version: String, | ||
| } | ||
| impl RequestBuilder { | ||
| pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { | ||
| #[doc = "Send the request and returns the response."] | ||
| pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> { |
There was a problem hiding this comment.
The send function will send the request and return the response. There is no into_body function on the Response or this RequestBuilder because there is no body returned in the API specification. Since there are headers, typed access to the headers will be provided (in the next pull request).
|
Here is a cadl for how the SDK is modeling the function. But when you put it in openapi, you are missing a bunch of the design. Eventually, we'll move the specs to cadl https://github.com/Azure/cadl-azure/issues/1948 and it we will be able to generate code closer to what the SDK is doing. |
This contains all of the AutoRust changes in #1040. It limits the code generation to the azure_svc_blobstorage crate and the package-2021-02 package. The operation
Service_GetAccountInfois a good example to focus on. It is implemented in our SDK and I #1039 contains the corresponding .NET SDK code for both its generated rest client and the manually coded SDK.Here is the API specification:
https://github.com/Azure/azure-rest-api-specs/blob/2ed424dccf778022a6babff3b655203aa78ec0d8/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-02-12/blob.json#L421-L532
The implementation from the SDK:
azure-sdk-for-rust/sdk/storage/src/account/operations/get_account_information.rs
Lines 1 to 49 in 25538f4
Today, in the generated crate, the response body is returned. There is no response body, so
()is returned.azure-sdk-for-rust/services/svc/blobstorage/src/package_2021_02/mod.rs
Lines 607 to 644 in 25538f4
This pull request will return a
Responsetype instead. In a follow-up PR, it will allow access to the headers.