Take, for example: (Rust PR) (TypeSpec PR)
We have this defined (Access.internal):
alias StructuredBodyParameter = {
/** Required if the request body is a structured message. Specifies the message schema version and properties. */
@access(Access.internal)
@header("x-ms-structured-body")
structuredBodyType?: string;
};
And lets look at append_block in routes.tsp:
AppendBlock is StorageOperationRequestBody<
{
/** The data to upload. */
...BodyParameter;
...TimeoutParameter;
...ContentLengthParameter;
...ContentMd5Parameter;
...ContentCrc64Parameter;
...LeaseIdOptionalParameter;
...BlobConditionMaxSizeParameter;
...BlobConditionAppendPosParameter;
...EncryptionKeyParameter;
...EncryptionKeySha256Parameter;
...EncryptionAlgorithmParameter;
...EncryptionScopeParameter;
...IfModifiedSinceParameter;
...IfUnmodifiedSinceParameter;
...IfNoneMatchParameter;
...IfMatchParameter;
...IfTagsParameter;
...StructuredBodyParameter;
...StructuredContentLengthParameter;
},
(thus Access.internal) and so now looking at the Rust impl:
pub async fn append_block(
&self,
body: RequestContent<Bytes, NoFormat>,
content_length: u64,
options: Option<AppendBlobClientAppendBlockOptions<'_>>,
) -> Result<Response<AppendBlobClientAppendBlockResult, NoFormat>> {
...
...
if let Some(structured_body_type) = options.structured_body_type.as_ref() {
request.insert_header("x-ms-structured-body", structured_body_type);
}
...
...
Because it still is being generated (associated options bag):
pub struct AppendBlobClientAppendBlockOptions<'a> {
...
...
/// Required if the request body is a structured message. Specifies the message schema version and properties.
pub structured_body_type: Option<String>,
/// Required if the request body is a structured message. Specifies the length of the blob/file content inside the message
/// body. Will always be smaller than Content-Length.
pub structured_content_length: Option<u64>,
...
...
}
Thanks!
Take, for example: (Rust PR) (TypeSpec PR)
We have this defined (Access.internal):
And lets look at
append_blockinroutes.tsp:(thus
Access.internal) and so now looking at the Rust impl:Because it still is being generated (associated options bag):
Thanks!