|
| 1 | +import "@azure-tools/typespec-client-generator-core"; |
| 2 | +import "./main.tsp"; |
| 3 | + |
| 4 | +using TypeSpec.Http; |
| 5 | +using Azure.ClientGenerator.Core; |
| 6 | +using Storage.Blob; |
| 7 | + |
| 8 | +namespace Customizations; |
| 9 | + |
| 10 | +/** Parameters to be added in client constructors */ |
| 11 | +model BlobServiceClientParameters { |
| 12 | + ...ContainerNamePathParameter; |
| 13 | + ...BlobPathParameter; |
| 14 | +} |
| 15 | + |
| 16 | +@@clientNamespace(Storage.Blob, "Azure.Storage.Blobs"); |
| 17 | +@@clientNamespace(Storage.Blob.Container, "Azure.Storage.Blobs"); |
| 18 | +@@clientNamespace(Storage.Blob.Container.Blob, "Azure.Storage.Blobs"); |
| 19 | +@@clientNamespace(Storage.Blob.Container.Blob.AppendBlob, |
| 20 | + "Azure.Storage.Blobs" |
| 21 | +); |
| 22 | +@@clientNamespace(Storage.Blob.Container.Blob.BlockBlob, "Azure.Storage.Blobs"); |
| 23 | +@@clientNamespace(Storage.Blob.Container.Blob.PageBlob, "Azure.Storage.Blobs"); |
| 24 | + |
| 25 | +@@clientName(Storage.Blob, "BlobServiceClient", "rust"); |
| 26 | +@@clientName(Storage.Blob.Container, "BlobContainerClient", "rust"); |
| 27 | +@@clientName(Storage.Blob.Container.Blob, "BlobClient", "rust"); |
| 28 | +@@clientName(Storage.Blob.Container.Blob.AppendBlob, |
| 29 | + "AppendBlobClient", |
| 30 | + "rust" |
| 31 | +); |
| 32 | +@@clientName(Storage.Blob.Container.Blob.BlockBlob, "BlockBlobClient", "rust"); |
| 33 | +@@clientName(Storage.Blob.Container.Blob.PageBlob, "PageBlobClient", "rust"); |
| 34 | + |
| 35 | +@@clientInitialization(Storage.Blob.Container, |
| 36 | + { |
| 37 | + parameters: ContainerNamePathParameter, |
| 38 | + initializedBy: InitializedBy.parent | InitializedBy.individually, |
| 39 | + } |
| 40 | +); |
| 41 | +@@clientInitialization(Storage.Blob.Container.Blob, |
| 42 | + { |
| 43 | + parameters: BlobServiceClientParameters, |
| 44 | + initializedBy: InitializedBy.parent | InitializedBy.individually, |
| 45 | + } |
| 46 | +); |
| 47 | +@@clientInitialization(Storage.Blob.Container.Blob.AppendBlob, |
| 48 | + { |
| 49 | + parameters: BlobServiceClientParameters, |
| 50 | + initializedBy: InitializedBy.parent | InitializedBy.individually, |
| 51 | + } |
| 52 | +); |
| 53 | +@@clientInitialization(Storage.Blob.Container.Blob.BlockBlob, |
| 54 | + { |
| 55 | + parameters: BlobServiceClientParameters, |
| 56 | + initializedBy: InitializedBy.parent | InitializedBy.individually, |
| 57 | + } |
| 58 | +); |
| 59 | +@@clientInitialization(Storage.Blob.Container.Blob.PageBlob, |
| 60 | + { |
| 61 | + parameters: BlobServiceClientParameters, |
| 62 | + initializedBy: InitializedBy.parent | InitializedBy.individually, |
| 63 | + } |
| 64 | +); |
| 65 | + |
| 66 | +@@clientName(ContainerProperties.denyEncryptionScopeOverride, |
| 67 | + "PreventEncryptionScopeOverride" |
| 68 | +); |
| 69 | +@@clientName(ContainerProperties.immutableStorageWithVersioningEnabled, |
| 70 | + "IsImmutableStorageWithVersioningEnabled" |
| 71 | +); |
| 72 | +@@clientName(BlobPropertiesInternal.expiryTime, "ExpiresOn"); |
| 73 | +@@clientName(BlobPropertiesInternal.sealed, "IsSealed"); |
| 74 | +@@clientName(BlobPropertiesInternal.lastAccessTime, "LastAccessedOn"); |
| 75 | +@@clientName(BlobPropertiesInternal.immutabilityPolicyUntilDate, |
| 76 | + "ImmutabilityPolicyExpiresOn" |
| 77 | +); |
| 78 | + |
| 79 | +@@clientName(MetadataHeaders.metadata, "metadata", "rust"); |
| 80 | +@@clientName(ObjectReplicationHeaders.objectReplicationRules, |
| 81 | + "objectReplicationRules", |
| 82 | + "rust" |
| 83 | +); |
| 84 | + |
| 85 | +@@alternateType(BlobPropertiesInternal.contentLength, uint64, "rust"); |
| 86 | +@@alternateType(BlobContentLengthRequired.blobContentLength, uint64, "rust"); |
| 87 | +@@alternateType(ContentLengthResponseHeader.contentLength, uint64, "rust"); |
| 88 | +@@alternateType(ContentLengthParameter.contentLength, uint64, "rust"); |
| 89 | +@@alternateType(StructuredContentLengthParameter.structuredContentLength, |
| 90 | + uint64, |
| 91 | + "rust" |
| 92 | +); |
| 93 | +@@alternateType(StructuredContentLengthResponseHeader.structuredContentLength, |
| 94 | + uint64, |
| 95 | + "rust" |
| 96 | +); |
| 97 | + |
| 98 | +@@scope(Storage.Blob.Container.submitBatch, "!rust"); |
| 99 | +@@scope(Storage.Blob.submitBatch, "!rust"); |
0 commit comments